PDA

View Full Version : how to call a function from the exception event of jsonStore



brazhuca
30 Jun 2011, 6:23 AM
Hi all,

I am using a EXT3.3
I am trying to call a function from the exception event of a json store, but it does not work.
When I try to call the functions from the load event, it works fine.

Any help will be appreciated.



App.UserGrid = Ext.extend(Ext.grid.GridPanel, {
id: 'userGridId',
trackMouseOver: true,
disableSelection: false,
loadMask: true,

initComponent:function() {

var selectionModel = new Ext.grid.CheckboxSelectionModel();

Ext.apply(this, {

// Creates the sata store
store: new Ext.data.JsonStore({
totalProperty: 'totalCount',
root: 'rowIndex',
autoLoad: true,
url: App.url,
fields: [
{name: 'id'},
{name: 'name'},
{name: 'email'},
{name: 'active'}
],
listeners: {
beforeload: function() {
//...
},
exception: function() {
Ext.getCmp('userGridId').getBottomToolbar().updateInfo();
myFunc('foo');
this.myOtherFunc('bar');
},
load: function() {
myFunc('foo');
this.myOtherFunc('bar');
}
}
})
});

App.UserGrid.superclass.initComponent.apply(this, arguments);
},
onRender: function() {
App.UserGrid.superclass.onRender.apply(this, arguments);
},
myOtherFunc: function(str) {
console.info(str);
}
});