PDA

View Full Version : Scope/access variables ?



muncher
8 Jul 2010, 11:52 AM
Ok, I have a form with some buttons and data store variable declared in it.
on clicking the button I call the overriden submit. which in turn makes an ajax call.
I get the data from ajax call but how do I reference the store inside that ajax success handler ?

Elijah
8 Jul 2010, 6:40 PM
I think this is what you were asking for.

Ext.Ajax.request({
scope:this,
url: 'API.jsp',
params: { api: 'logout' },
success: function(response, options){
try{
var obj = Ext.decode(response.responseText);
}catch(e){
// e.message
}
failure: function(response, options){
//...
}
})