1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    4
    Vote Rating
    0
    deepaExtJs is on a distinguished road

      0  

    Default Answered: clearOnLoad in a treestore problems (how to load the same node twice as child)

    Answered: clearOnLoad in a treestore problems (how to load the same node twice as child)


    I have to load a tree in which the child nodes are the same for many parent nodes.
    Eg
    parent1
    |
    --child1
    |
    parent2
    |
    --child1
    --child2
    |
    parent3
    |
    --child2
    --child3
    and so on.
    I have created an Ext.data.treeStore and am loading the children by chnaging the url in the beforeload listener.
    Now the problem is, my store removes all duplicates(i cannot load child1 twice onto the store) and hence am not able to expand my tree
    Note that the following works
    parent1
    |
    --child1
    |
    parent2
    |
    --child2
    |
    parent3
    |
    --child3
    I ahve tried setting clearOnLoad to false and a few other things but not getting anywhere.
    Any input and directions would greatly help! please

    Thanks

  2. You cannot have two items in the same tree with the same id. If you need to have the same item in multiple paths in the tree it will have to have a unique id for each instance.

  3. #2
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    St Louis,MO
    Posts
    267
    Answers
    20
    Vote Rating
    18
    James Goddard will become famous soon enough James Goddard will become famous soon enough

      1  

    Default


    You cannot have two items in the same tree with the same id. If you need to have the same item in multiple paths in the tree it will have to have a unique id for each instance.

  4. #3
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    4
    Vote Rating
    0
    deepaExtJs is on a distinguished road

      0  

    Default Thanks

    Thanks


    that helps. I have changed the model to return nodes with unique ids even though their content is the same.
    I am suprised a treestore cannot have same child nodes in the store!

Thread Participants: 1

Tags for this Thread