1. #1
    Sencha User demon222's Avatar
    Join Date
    Jan 2008
    Location
    Poland, Warsaw
    Posts
    124
    Vote Rating
    2
    Answers
    4
    demon222 is on a distinguished road

      0  

    Default Answered: How to add arrow to nestedList

    Answered: How to add arrow to nestedList


    How to add arrow to nestedList ???

  2. You can override the getItemTextTpl method to provide a string. This string will later be added to the itemTpl of the lists. Hopefully you can simply add a new element and float it to the right and style it:

    Code:
    getItemTextTpl : function(node) {
        return '{' + this.displayField + '}<div class="list-arrow"></div>';
    }
    Code:
    .list-arrow {
        float : right;
        height : 1em;
        width : 1em;
        background-image: url(...);
    }

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    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


    Where do you want this arrow to be? On a non-leaf list item?
    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.

  4. #3
    Sencha User demon222's Avatar
    Join Date
    Jan 2008
    Location
    Poland, Warsaw
    Posts
    124
    Vote Rating
    2
    Answers
    4
    demon222 is on a distinguished road

      0  

    Default


    yes

    I on the right arrow to make it (non-leaf)

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    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


    You can override the getItemTextTpl method to provide a string. This string will later be added to the itemTpl of the lists. Hopefully you can simply add a new element and float it to the right and style it:

    Code:
    getItemTextTpl : function(node) {
        return '{' + this.displayField + '}<div class="list-arrow"></div>';
    }
    Code:
    .list-arrow {
        float : right;
        height : 1em;
        width : 1em;
        background-image: url(...);
    }
    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.

  6. #5
    Sencha User demon222's Avatar
    Join Date
    Jan 2008
    Location
    Poland, Warsaw
    Posts
    124
    Vote Rating
    2
    Answers
    4
    demon222 is on a distinguished road

      0  

    Default


    ok work ...
    thx

    PHP Code:
    Ext.require(
        [
        
    'Ext.data.Model'
        
    'Ext.data.TreeStore',
        
    'Ext.app.Application',
        
    'Ext.field.TextArea',
        
    'Ext.dataview.NestedList'
        
    ],
        function() {    
            
    Ext.override(Ext.dataview.NestedList, {
                
    getItemTextTpl: function(node) {
                    return 
    '{' this.getDisplayField() + '}<div class="list-arrow"></div>';
                }
            });
        }); 

  7. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    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


    Fantastic!
    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.

  8. #7
    Sencha User demon222's Avatar
    Join Date
    Jan 2008
    Location
    Poland, Warsaw
    Posts
    124
    Vote Rating
    2
    Answers
    4
    demon222 is on a distinguished road

      0  

    Default


    this.getDisplayField() ---- NOT: this.displayField!
    thx