-
29 Aug 2012 5:09 AM #1
Answered: Waiting message while removing records of a grid
Answered: Waiting message while removing records of a grid
Hello,
I want to add a waiting message while I remove records from my grid.
If I leave the code like this, nothing happen.Code:removeRecord: function (c,record,index,e){ myGrid = Ext.getCmp('metrSeriesGridId'); myGrid.setLoading("Loading"); var store = Ext.getStore('NrrSeriesStore'); var toRemove = []; store.each(function (record) { if (record.get('CODEFC') === valueToRemove) { toRemove.push(record); } }); store.suspendEvents(); store.remove(toRemove); store.resumeEvents(); myGrid.getView().refresh(); myGrid.setLoading(false);
If I remove the setLoafing(false); then I see the waiting message but it doesn't dissapear.
It also seems that the loading message comes only after I removed the records...
Anyone could help me?
Thanks
-
Best Answer Posted by redraid
Replace
store.sync({
callback: function () {
el.unmask();
}
});
with:
Ext.Function.defer(function(){ el.unmask();},100);
-
29 Aug 2012 5:17 AM #2
Try this:
Code:removeRecord: function (c,record,index,e){ var myGrid = Ext.getCmp('metrSeriesGridId'), el = myGrid.getEl(); // show mask el.mask('Removing records...'); var store = Ext.getStore('NrrSeriesStore'); var toRemove = []; store.each(function (record) { if (record.get('CODEFC') === valueToRemove) { toRemove.push(record); } }); store.suspendEvents(); store.remove(toRemove); store.resumeEvents(); store.sync({ callback: function () { el.unmask(); } });
-
29 Aug 2012 5:48 AM #3
same problem
same problem
Still the same problem, if I remove the callback function I see the message but it doesn't dissapear If I leave it no message appears.
-
29 Aug 2012 5:57 AM #4
Replace
store.sync({
callback: function () {
el.unmask();
}
});
with:
Ext.Function.defer(function(){ el.unmask();},100);
-
29 Aug 2012 6:23 AM #5
It works.
Thanks


Reply With Quote