-
23 Feb 2012 7:25 AM #1
[B3] Cannot seem to relay the load event from store to grid
[B3] Cannot seem to relay the load event from store to grid
In B3 I'm unable to relay a grid's store's load event to the grid. Was working ok in B2.
Code:Ext.onReady(function () { var grid = Ext.widget('gridpanel', { title: 'My Grid' , height: 200 , width: 200 , renderTo: Ext.getBody() , columns: [{ text: 'Header Text' , dataIndex: 'foo' }] , store: { fields: ['foo'] , proxy: {...} , listeners: { load: function () { console.log('store handled load event') } } } , listeners: { beforerender: function (grid) { grid.relayEvents(grid.getStore(), ['load']); } , load: function () { console.log('grid handled load event') } } }); });
-
23 Feb 2012 7:31 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
I did this with beta3:
And I got these console logs:Code:var grid = new Ext.grid.Panel({ title: 'My Grid' , height: 200 , width: 200 , renderTo: Ext.getBody() , columns: [{ text: 'Header Text' , dataIndex: 'title' }] , store: { fields: ['foo'] , proxy: { type : 'ajax', url : 'data/json.json' } , listeners: { load: function () { console.log('store handled load event') } } } , listeners: { beforerender: function (grid) { grid.relayEvents(grid.getStore(), ['load']); grid.getStore().load(); } , load: function () { console.log('grid handled load event') } } });
Screen Shot 2012-02-23 at 9.31.12 AM.pngMitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Feb 2012 7:35 AM #3
Ok. Let me do some more digging. I abstracted that sample code from an existing project that is failing when I use the B3 library, but works when I move back to B2. I'll see if I can isolate a better test case.
Thx
-
23 Feb 2012 9:27 AM #4
I think I was able to root cause the issue I was seeing. Opened a distinct thread for the issue to make it easier to find/comment.
http://www.sencha.com/forum/showthre...roller.Control


Reply With Quote