Reputation: 87
Hello i am creating a panel window and i want to save data after fill valid id. if id does not exits then i show a panel window and here will be create a valid id. After create valid id user will close window. After close window i have need to form on server. I am also attaching code and screenshot
// check id exist on database or not
var myId= me.lookupReference('myId').getValue();
Ext.Ajax.request({
url: './MyController/CheckExistId',
method: 'POSt',
params: {
myId: myId
},
success: function (response) {
var result = Ext.JSON.decode(response.responseText);
if (result.success === true && result.data !== null) {
if (result.data === 0) {
Ext.create('MySample.view.register', { id: myId }).show();
}
else {
me.submitData();
}
}
}
Window screenshot for create new id
after close window i want to submit form automatically by using me.submitData() function
Upvotes: 1
Views: 1182
Reputation: 408
Add a listener to MySample.view.register
like:
Ext.create('MySample.view.register', {
id: myId,
closeAction : 'destroy',
listeners: {
// catch the close action
'destroy' : function() {
me.submitData();
}
}).show();
The event to catch is based on which kind of component MySample.view.register
is extending of.
Upvotes: 2