Results 1 to 2 of 2

Thread: Nested TreeStores

  1. #1
    Sencha User
    Join Date
    May 2011
    Moscow, Russia
    Vote Rating

    Default Nested TreeStores


    I have an application that works with three kinds of objects (Foo, Bar and Baz). The user can create and manage lists of these objects. The lists can furthermore be grouped, thus creating a tree-like structure.

    I want to use one TreeStore for each kind of lists (`store.FooLists`, etc.) for adding, changing and deleting the lists. This is easy enough.

    I also want to have a sidebar with a unified tree panel. It goes like this:

    +-- Foo
    |   |
    |   +-- All Foos
    |   +-- List 1
    |   +-- List 2
    |   +-- List Group 1
    |       |
    |       +- List 3
    +-- Bar
    |   |
    |   +-- All Bars
    |   +-- ...
    +-- Baz
        +-- All Baz's
        +-- ...
    So, I need another TreeStore for this sidebar. But I want the "List X" items to be loaded from the respective TreeStores (`FooLists`, `BarLists`, `BazLists`).

    What is the cleanest way to embed one TreeStore inside another, so that changes in the embedded store propagate up and cause a refresh of the sidebar view?

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Aberdeen, Scotland
    Vote Rating


    Has anybody else come across a solution to this? I'm also trying to do something very similar. I also have three kind of objects which are related using a hasMany association.

    Is there any way to load a tree where instead of using "children" it will use the hasMany association? This is seems to be quite key to using MVC properly but it seems you're not able to do this with Extjs4 at the moment.

    There also seems to be a problem where the three different kind of models have conflicting ids with each other because it uses the id of the model which is not unique in a tree with more than one kind of model.

    Any suggestions on how to progress with this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts