1. #1
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default [4.1 b2] TreeLoading - Concurrency Problem + Late Loading

    [4.1 b2] TreeLoading - Concurrency Problem + Late Loading


    With loading the tree data from the back end I face two issues
    • The TreeStore.load function is not concurrency save.
    • How to separate the View initialization from the TreeLoading is not at all obvious.
    To illustrate this problem I have deployed a simple example to http://enpasos.com/testTreeLoad/

    The left side has a naive call of the load function that shows both problems (to see the concurrency issue you need to click the panel's reload button rapidly).

    The right side shows the workaround that I use until the load function is bulletproof:
    Code:
        
    loadTreeWorkaround: function() { 
            var store = this.getTreeS_FixedStore();
            var root = store.getRootNode();
            if (root.isExpanded()) {
                if (!store.isLoading())
                    store.load();
            } else {
                root.set('expanded', false);
                root.expand(); 
            }
        }
    In my opinion the concurrency issue - that is not new - needs to get high attention!

  2. #2
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    Any idea?

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2011
    Posts
    62
    Vote Rating
    0
    ExtJSNinjas is on a distinguished road

      0  

    Default idea

    idea


    I'm not entirely sure I understand what you are attempting to do, but are you aware that load and expand have callbacks that you can use? That way you will know when they have finished.

    this.store.load({node: node, callback: function(records, operation, success) {
    node.expand();
    }});

    The second parameter of "expand" on a node is the callback function (not shown in the above example), as well. Just thought I'd post this in case it helps resolve what seem like timing issues.

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Germany, Frankfurt
    Posts
    142
    Vote Rating
    1
    enpasos is on a distinguished road

      0  

    Default


    The only thing that I want to do is to allow users to call
    Code:
    store.load()
    often. In my opinion such a central function offered by the ExtJS framework should allow subsequent calls without ending in a inconsistent state. It should not be the tasks of the developer who calls the function to prohibit inconsistent states.

Thread Participants: 1