Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    treinar is on a distinguished road

      0  

    Default NestedList no longer handles multiline items in Sencha Touch 2.1

    NestedList no longer handles multiline items in Sencha Touch 2.1


    REQUIRED INFORMATION

    Sencha Touch version tested:
    • Sencha Touch 2.1
    Browser versions tested against:
    • Chrome Version 23.0.1271.64

    Touch devices tested against:
    • Samsung galaxy S2
    • iPad 1
    Description:
    • When using NestedList and rendering contents for each item using getItemTextTpl(), the height of each item is not adjusted correctly if the text for the item is multiline
    Steps to reproduce the problem:
    • In docs for 2.1, API doc for NestedList, change the code for the example using "Code editor". Add this to the definition of var nestedList:
      Code:
      getItemTextTpl: function(nodeItem) {return 'Line 1<br/>Line 2';}
    • Switch back to "Live preview"
    The result that was expected:
    • A list with two lines for each item, with height for each item correctly adjusted
    The result that occurs instead:
    • A list with the separators and items misaligned
    If you go to the 2.0 docs and try the same thing on the same example, everything looks as expected.


    HELPFUL INFORMATION

    I have not looked very closely into the reason for this change in behaviour, but I can see that the rendering of the list items have changed significantly from 2.0 to 2.1. Amongst other, the position for each .x-list-item now is absolute, which leads me to think that there is some kind of computation of the top positon of each item.

    Possible fix:
    • not provided
    Additional CSS used:
    • none
    Operating System:
    • Ubuntu 12.04

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

      1  

    Default


    You just need to turn on variableHeights:

    Code:
    getItemTextTpl : function (nodeItem) {
        return 'Line 1<br/>Line 2';
    },
    listConfig     : {
        variableHeights : true
    }
    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
    Dec 2011
    Posts
    5
    Vote Rating
    0
    treinar is on a distinguished road

      0  

    Default


    Ah... no bug then. I can confirm that this solution works on my actual code.

    Thanks a lot for your help!

    Tor-Einar Skog

Thread Participants: 1

Tags for this Thread