-
10 Jun 2009 1:39 AM #1
[SOLVED] DirectStore not Firing Load Event
[SOLVED] DirectStore not Firing Load Event
Hello,
I recently attempted to switch from a JsonStore to a DirectStore (for experimental reasons) and I can;t get the load event to fire anymore. The code for the store is below which is almost identical to the old JsonStore. Am I doing something wrong?
The direct function is being called and returning a result but the event just doesn't fire (Ext 3.0 RC2).Code:var store = new Ext.data.DirectStore({ idProperty: 'ID', fields: ['ID', 'Title', 'Samples'], directFn:SamplesActions.getCatalog, listeners: { load : function(s, rec) { debugger; s.each(function(r) { tpl.append('sample-menu', r.data); }); setTimeout(function() { Ext.get('loading').remove(); Ext.fly('loading-mask').fadeOut({remove: true}); }, 250); } } });
Any help would be appreciated.
James.
-
10 Jun 2009 12:35 PM #2
Try this:
Code:var store = new Ext.data.DirectStore({ idProperty: 'ID', fields: ['ID', 'Title', 'Samples'], directFn:SamplesActions.getCatalog, paramsAsHash:false, root:'', listeners: { load : function(s, rec) { debugger; s.each(function(r) { tpl.append('sample-menu', r.data); }); setTimeout(function() { Ext.get('loading').remove(); Ext.fly('loading-mask').fadeOut({remove: true}); }, 250); } } });
-
11 Jun 2009 12:06 AM #3
Brilliant. This works as expected. Thanks.


Reply With Quote