1. #1
    Touch Premium Member
    Join Date
    Dec 2011
    Posts
    13
    Vote Rating
    0
    NJS is on a distinguished road

      0  

    Default Unanswered: NestedList - jump to a card ( setActiveItem ? )

    Unanswered: NestedList - jump to a card ( setActiveItem ? )


    Hello

    I am trying to trigger a nestedlist to open a specific detailcard.

    I'm trying to use the setActiveItem method but am unsure of the syntax, so...
    - how do I target the nestedlist? (can I use Ext.getCmp) ?
    - how do I target the detailcard to open?

    I've tried:
    Code:
    var myNestedList = Ext.getCmp('nestedListComponentID');
    myNestedList.setActiveItem(3); // set by component ID and card index?
    myNestedList.setActiveItem('detailcardxtype'); // set by detail card's xtype name as set in the store?
    myapp.views.NestedListMenu.setActiveItem(3); // from where the list was created, eg myapp.views.NestedListMenu = Ext.extend(Ext.NestedList, {...
    
    plus so many more combinations, just can't nail it. Please put me out of my misery

    PS. I also set the layout of the nestedlist to
    Code:
    layout: {type: 'card'}
    Any help would be most appreciated!
    Thanks
    NJ

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Answers
    3447
    Vote Rating
    814
    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


    NestedList already uses card layout so you do not need to set it. To target the NestedList I would not use id and getCmp. You can put it on the namespace or use ComponentQuery to resolve it. NestedList switches active item per the node that was tapped.
    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
    Touch Premium Member
    Join Date
    Dec 2011
    Posts
    13
    Vote Rating
    0
    NJS is on a distinguished road

      0  

    Default


    Can you jump to a NestedList detailCard programmatically, using setActiveItem?

    Thanks

Thread Participants: 1

Tags for this Thread