Hi,
I have a problem in closing the window.
I have a pop up window with an input text field and a save button.That pop up will come on click of a button.
on click of save button the value of input text will save and pop up will close.
The problem is after click on save button the value is getting saved and the pop up is closing but after that when i am again opening the pop up by clicking the button the trying to close it then the background remains masked.
Bellow is the codes for ur review..
Code of button for which the pop up will come
Code:
{
xtype : 'button',
text : '<img src="images/Preferences.png "/>',
cls : 'iconButton',
width : 40,
height : 40,
margin : 12,
tooltip : '<b>Preference</b><br> Please click the button to insert an Preference',
action : 'settings'
}
Controller part for the button
Code:
settingsFn: function() {
prefWindow = new MY.view.PreferenceWindow;
prefWindow.showAt(600,300);
},
mu pop up window
Code:
Ext.define('MY.view..PreferenceWindow', {
extend:'Ext.window.Window',
alias: 'widget.preferencewindow',
id:'preferencewindow',
title: 'My Preference',
height: 200,
width: 700,
modal:true,
layout: {
type: 'hbox',
align: 'middle'
},
items: [ {
xtype: 'textfield',
itemId:'prefName',
hideLabel: true,
flex: 1,
},{
xtype: 'button',
text: 'Save',
id:'saveId',
action:'closePref',
}
]
});
In controller.....for save button
Code:
closePreffn: function() {
var prefname = this.getPreferenceWindow().getComponent('prefName').getValue();
var filterpanel=this.getSummaryLeftPanel();
var scgrid = Ext.widget('scpopup').getComponent('sccheckgrid');
var stcgrid = Ext.widget('stcpopup').getComponent('stccheckgrid');
var scselection = scgrid.getSelectionModel().getSelection();
var scselected = [];
for ( var i = 0; i < scselection.length; i++) {
scselected.push(scselection[i].data.shippingConditionValue);
}
var stcselection = stcgrid.getSelectionModel().getSelection();
var stcselected = [];
for ( var j = 0; j < stcselection.length; j++) {
stcselected.push(stcselection[j].data.shipToCountryValue);
}
Ext.Ajax.request({
url : './cutomerFreightCharges/1/insertPref.do',
params : {
shippingCondition : scselected,
shipToCountry : stcselected,
prefName : prefname
},
success : function(response){
var pref = Ext.getCmp('prference');
pref.getStore().reload();
}
});
prefWindow.hide();
}
Actually the save button and the close(X) one working individually fine.
But when i am clicking the save button then the window is getting closed and after that for second time when i am trying to close th window without clicking the save button the background remains masking.