Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    May 2010
    Posts
    27
    Vote Rating
    0
    clavinovahan is on a distinguished road

      0  

    Exclamation How to avoid async call when expand tree node if model data ready in tree store

    How to avoid async call when expand tree node if model data ready in tree store


    I have Async tree and I preload the model data into the tree store and then I use selection model to select a node in the tree. It is supposed to expand the tree path all the way to the node selected. But the tree still make the async call one by one all the way down to the selected node.

    Why the model data in the tree store already and it still make async call when expand the tree node? Is there any way to disable the async service call if the data already in the tree store?

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    54
    Vote Rating
    0
    petko.ivanov is on a distinguished road

      0  

    Default


    i just hit the same behavior and i am looking for a solution:
    * full tree is initially loaded via rpc proxy
    * despite of this - on click, it makes a new rpc call
    seems like the tree is designed either to have all the info locally or load at each level. This in-between state should be easy to do perhaps by extending TreeGrid. Does any one have it coded?
    If i dont hear anything by end of the weekend , i will have a crack at it..
    thanks

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    54
    Vote Rating
    0
    petko.ivanov is on a distinguished road

      0  

    Default


    my current solution is to have a temp store with the rpc loader. i dont display it but just add a store listener that simply copies the data to the actual store. think that will work because should behave exactly like the static data loading. so far works as intended.

  4. #4
    Ext User
    Join Date
    May 2010
    Posts
    27
    Vote Rating
    0
    clavinovahan is on a distinguished road

      0  

    Default


    Would it be possible to tell me what listener you added and how to copy the data?

    Thanks.

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    54
    Vote Rating
    0
    petko.ivanov is on a distinguished road

      0  

    Default


    delegate is the real Grid that gets the data via RPC
    Code:
    if (delegate!=null){
                delegate.getTreeStore().addStoreListener(new StoreListener<BaseModel>(){
    
                    @Override
                    public void storeDataChanged(StoreEvent<BaseModel> se) {
                        act();
                    }
                    private void act(){
                        final List<BaseModel> models = delegate.getTreeStore().getModels();
                            DeferredCommand.addCommand(new Command() {
                                public void execute() {
                                    long time1 = System.currentTimeMillis();
                                    grid.getTreeStore().removeAll();
                                    for(ColumnConfig cc : grid.getColumnModel().getColumns()){
                                        String header = cc.getId();
                                        DependentRule.RecursiveTotalRule aggregator = new DependentRule.RecursiveTotalRule(header );
                                        for(BaseModel bm : models){
                                            aggregator.get(bm);
                                        }
                                    }
                                    grid.getTreeStore().add(models, true);
                                    GWT.log("data copied and aggregated in "+(System.currentTimeMillis()-time1), null);
                                }
                            });
                        }
                    }                
                    @Override
                    public void storeAdd(StoreEvent<BaseModel> se) {
                        act();
                    }
                    @Override
                    public void storeUpdate(StoreEvent<BaseModel> se) {
                        act();
                    }
                });
    The deferred command copies the data from the delegate and aggregates it. Because only my leaf nodes contain full data, the grouping nodes only contain the grouping information.

Similar Threads

  1. To stop tree loader to call on tree expand
    By Sejal in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 28 Apr 2010, 12:57 AM
  2. [CLOSED] The parent of selected tree node is NULL in Async Tree
    By fangning in forum Ext GWT: Bugs (2.x)
    Replies: 3
    Last Post: 10 Nov 2009, 12:15 AM
  3. [CLOSED][3.0rc1] Async Tree node doesn't expand
    By Sesshomurai in forum Ext 3.x: Bugs
    Replies: 3
    Last Post: 29 Apr 2009, 5:47 AM
  4. RpcProxy as way to avoid GWT async rpc model
    By cri1258 in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 7 Mar 2009, 9:35 AM
  5. call function on dblclick of tree node and disable expand/collapse
    By vayumahesh in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Nov 2008, 10:30 AM

Thread Participants: 1