1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    62
    Vote Rating
    0
    Answers
    1
    ljadrbln is on a distinguished road

      0  

    Default Unanswered: Call function from the NestedList detailCard

    Unanswered: Call function from the NestedList detailCard


    Hello,

    Is it a possible to call custom function from the detail card instance?

    I have this NestedList component:

    Code:
    Ext.define('App.view.AllWorksList', {
        extend: 'Ext.dataview.NestedList',
        xtype: 'appListView',
        requires: ['App.view.Detail'],
    
        config: {
            flex: 2,
            title: 'List',
            //Create details card
            detailCard: Ext.create('App.view.Detail'),
            store: 'Users'
        },
    
        getItemTextTpl: function(node){
            return '<div class="contact2">{id}, {title}</div>';
        },
    
        updateUserData: function(){
            console.log('Update user data function');
        }
    });
    Controller:
    Code:
    ......................
    control: {
        userList: {
            leafitemtap: 'onLeafItemTap'
        }
    },
    ......................
    
        onLeafItemTap: function(me, list, index){
            var detailCard = me.getDetailCard(),
    	     rec = list.getStore().getAt(index);
             
             //Try to call function, but the are no needfull 
             detailCard.updateUserData();
        }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    Answers
    3574
    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


    The updateUserData method is on the NestedList not the detailCard so instead of

    Code:
    detailCard.updateUserData();
    try

    Code:
    me.updateUserData();
    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 User
    Join Date
    Nov 2007
    Posts
    62
    Vote Rating
    0
    Answers
    1
    ljadrbln is on a distinguished road

      0  

    Default


    Hello Mitchell,

    Thank you for taking time.
    I tried this code but I got the same error.

    I changed controller to:

    Code:
    detailsCnt: 'appListView > userDetails'
    and now I have access to the updateUserData function:

    Code:
    this.getDetailsCnt().updateUserData();
    This is a very weird behavior, because the same code works with latest Sencha PR, but doesn't work with Sencha RC.

Thread Participants: 1

Tags for this Thread