user2005049
user2005049

Reputation: 550

Extjs store 'update' and 'add' events not firing?

I have a Ext.data.Store, and I want the events to be firing when I add/update/delete records:

Ext.create('Ext.data.Store', {
 model: 'mSlide',
 listeners: {
              refresh: function(t, eOpts){
               alert('111111111');
              },
              datachanged: function(t, eOpts) {
                alert('22222');
            },
             update: function(t, record, operation, modifiedFieldNames, eOpts){
               alert('33333333');
             }
        },
 data : []     

});

None of these events firing, How can I solve it?

thank you very much....

Upvotes: 0

Views: 3957

Answers (1)

Vivek Vardhan
Vivek Vardhan

Reputation: 1178

Try to bind the listeners added to underlying property of panel, where store is present.

See Listeners in ExtJs Store

It says :While some Ext JS Component classes export selected DOM events (e.g. "click", "mouseover" etc), this is usually only done when extra value can be added. For example the DataView's itemclick event passing the node clicked on. To access DOM events directly from a child element of a Component, we need to specify the element option to identify the Component property to add a DOM listener to

Upvotes: 1

Related Questions