1. #1
    Sencha User
    Join Date
    Feb 2008
    Location
    Italy
    Posts
    20
    Vote Rating
    0
    BrightSoul is on a distinguished road

      0  

    Thumbs up Adding a separator between treenodes

    Adding a separator between treenodes


    Hello,
    I'm loading data into a treepanel from an external php file which produces the following output.

    Code:
    [{"text":"file1.txt","id":file1","leaf":true,"cls":"file"},
    {"text":"file2.txt","id":file2","leaf":true,"cls":"file"},
    {"text":"file3.txt","id":file3","leaf":true,"cls":"file"}]
    What I want to do now is to add a separator between the second and the third node. I tried doing this:

    Code:
    [{"text":"file1.txt","id":file1","leaf":true,"cls":"file"},
    {"text":"file2.txt","id":file2","leaf":true,"cls":"file"},
    "-",
    {"text":"file3.txt","id":file3","leaf":true,"cls":"file"}]
    but (obviously) it's not working. How do I add an horizontal line (ie: a separtor) between those elements?

    Thanks for your support.
    Bye.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,990
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I don't think this is possible without a reasonable amount of hacking the tree.

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Location
    Italy
    Posts
    20
    Vote Rating
    0
    BrightSoul is on a distinguished road

      0  

    Default


    can I at least customize the style of the second node so it has a "border-bottom:1px solid"? That would look like a separator.


    Edit: Ok, I managed to do it. I just changed the cls for the second node, like this:

    Code:
    [{"text":"file1.txt","id":file1","leaf":true,"cls":"file"},
    {"text":"file2.txt","id":file2","leaf":true,"cls":"fileseparator"},
    {"text":"file3.txt","id":file3","leaf":true,"cls":"file"}]
    and added this to my css code:

    Code:
    .fileseparator {border-bottom:1px solid black}
    Sorry for the silly question, that was easy enough to solve by myself

Thread Participants: 1