1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    24
    Vote Rating
    9
    josh.tingle will become famous soon enough

      2  

    Default Unanswered: TreeStore Errors

    Unanswered: TreeStore Errors


    I'm having a lot of trouble with the ext5 trees, so I figured I'd post here and see what you guys have noticed...

    The TreeStore appears to load twice if I set it to
    Code:
    autoload:true
    . Because of this, it somehow duplicates the nodes shown in the treepanel, causing all sorts of issues/errors...

    So, in creating a work-around, I set the TreeStore to
    Code:
    autoload:false
    and tried to just grab the store and load it, after the view was rendered. [fail]. The TreeStore loads just the one time, but the tree failed to actually render. Again, nothing was changed except having the store set to not autoload, and dropping this into the controller:

    Code:
    ...
    var s = Ext.getStore('myStore');
    s.load();
    ...
    No tree would get painted...

    So, workaround number two (AWFUL solution) - let the store autoload (with the two proxy calls), but after the tree renders, remove all the data, then load the store again manually.

    Code:
    (in the store)
    ...
    autoload: true
    ...
    
    (in the controller)
    ...
    var s = Ext.getStore('myStore');
    s.removeAll();
    s.load();
    ...
    Shazam! The tree loaded the final time, and only has the data represented once! No duplication!!

    However, now all the expanding and collapsing is broken. No events are firing, no expanding and collapsing of the nodes works.... Maybe the collapse/expand was already broken?

    Set autoload:true, take out the controller code.

    TreeStore loads twice; duplicate nodes in the treepanel; expand/collapse work properly.



    HELP... I don't know wtf is happening here.

  2. #2
    Sencha User
    Join Date
    Mar 2013
    Posts
    24
    Vote Rating
    9
    josh.tingle will become famous soon enough

      1  

    Default


    haha, work-around #3 seems to work pretty well, but seems completely ridiculous to have to do.

    TreeStore:
    Code:
    ...
    autoload: true,
    listeners: {
            beforeload: function (store, operation, eOpts) {
                if(store.isLoading()) return false;
            }
        }
    ...

  3. #3
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,483
    Vote Rating
    218
    Answers
    14
    LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold LesJ is a splendid one to behold

      0  

    Default


    FYI: A ticket has been entered for this bug.

Thread Participants: 1