1. #1
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,363
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default [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')
    			}
    		}
    	});
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    849
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I did this with beta3:

    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')
            }
        }
    });
    And I got these console logs:

    Screen Shot 2012-02-23 at 9.31.12 AM.png
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,363
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    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

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,363
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    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

Thread Participants: 1