1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    23
    Vote Rating
    1
    Answers
    1
    English is on a distinguished road

      0  

    Default Unanswered: Set getItemTextTpl in Nested List from Controller?

    Unanswered: Set getItemTextTpl in Nested List from Controller?


    I have a nested list in my MVC application. Part of the template (getItemTextTpl) needs to be translated according to the current language.
    This requires dynamically changing (or over-riding) the getItemTextTpl function.

    I have tried all ways to do this - both in the view, and in the controller, but it just doesn't change.

    Is this possible? How would it be achieved?

    My latest attempt is this (in the controller):
    Code:
    controller.getCurriculaList().getItemTextTpl=function(node){
       return '<div>...</div>';
    };
    Although this does alter the template, it's not getting the (node) parameter, so I can't do conditional formatting.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,710
    Vote Rating
    436
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    I assume a list has already been shown in the NestedList, in that case you would have to set the itemTpl on the child lists that were already created. setItemTpl actually had a bug in ST 2.1.0 that will be fixed in 2.1.1
    Mitchell 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.