Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

    Default [PR1] Selecting child items via controller

    [PR1] Selecting child items via controller


    In extjs4, I would have a TabPanel with grids in each tab. Depending on which one was selected is how I chose which store to load. In ST, I am using a carousel. I have one defined like this:

    Code:
    Ext.define('Ace.view.LinkSummaryCarousel', {
        extend: 'Ext.Carousel',
        xtype : 'linkcarousel',
        id    : 'linkSummaryCarousel',
        requires: ['Ace.view.LinkSummaryGrid', 'Ext.Carousel'],
        config: {
            title: 'Top Pages',
                items: [{
                    xtype : 'linkgrid',
                    ufq : 'somedata'
                },{
                    xtype : 'linkgrid',
                    ufq : 'moredata'
                }]
        }
    });
    So everything is loading fine, but I want to only load the store on the viewable grid. I am trying to do it like this in the controller:

    Code:
    refs: [
            { ref     : 'carousel',     selector: '#linkSummaryCarousel' }
        ],
    
        init: function() {   
            this.control({
                '#linkSummaryCarousel': {
                    show    : this.onLinkGridRender
                }
            });
    
        onLinkGridRender : function(me, eOpts) {
            console.log('grid render');
            //only load active item
            //var grid = this.getLinkcarousel();
            var grid = this.getLinkcarousel().getActiveItem();
            var x = grid.items.first();
            if (grid) {
                grid.getStore().load({params : {ufq : this.ufq}});
            }
        },
    I have attached a screenshot of what is available when I just execute this.getLinkcarousel(). getActiveItem() or the items array are not available. _items is empty array.
    Attached Images

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

  3. #3
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

    Default


    I didn't notice this on the PR2 list. Is this a deeper problem that may take a longer dev cycle?

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    MVC issues in general are being done together as part of a larger refactoring. These related issues are being reviewed as part of that process.

    Sencha Inc

    Jamie Avins

    @jamieavins

  5. #5
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    I don't understand why you are calling grid.items.first() - surely you just want this.getCarousel().getActiveItem().getStore().load() ?
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  6. #6
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

    Default


    grid.items.first() isn't actually doing anything. I just wanted to see what was contained there. You can see I have this right after:

    Code:
    if (grid) {
                grid.getStore().load({params : {ufq : this.ufq}});
            }

  7. #7
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Are you sure this is Controller-related? It doesn't look like it...
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  8. #8
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

    Default


    It sure seems like it, but if it isn't a problem in the controller, it's still got to be a bug. I am trying to get the view so I can get the store that is attached to it, but it is not working as expected. This is how I do it in extjs4 and it works.

    Where do you see a problem with the code?

  9. #9
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    It's impossible to know what is going on without knowing what your 'grid' class is. If it is just a carousel, you can use carousel.getItems().getAt(0) to get the first item.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  10. #10
    Sencha User
    Join Date
    Jun 2007
    Posts
    260
    Vote Rating
    4
    hallikpapa is on a distinguished road

      0  

    Default


    The grid class are different instances of the same grid panel plugin I found on these forums for ST. I need to do some more testing, because this same code started working in PR3, and hopefully it still works in PR4.