1. #1
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    xpouj04 is on a distinguished road

      0  

    Default Unanswered: Weird behavior load() method of TreeStore

    Unanswered: Weird behavior load() method of TreeStore


    Hi,


    I have a problem when calling load() method of Ext.data.TreeStore (I use Ext JS 4.0.7)
    The problem seems to depend on the JSON response object.


    In this case, no additional ajax requests are fired:
    Code:
    {text: 'ROOT', expanded: true, children: []}
    However in this case, two additional ajax requests are fired:
    Code:
    {text: 'ROOT', expanded: true, children: [{'id':'N01','text':'1','leaf':true},{'id':'N02','text':'2','leaf':true}]}
    I tried that with more responses and it comes out that the number of additional ajax calls depends on the number of JSON objects contained in the response, which is a big problem when trees are more complex


    Any solution or workaround?
    Thanks,
    Jan

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,798
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    When you do your load() call, do you pass in the node?

    Code:
    store.load({
        node : someNode
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Posts
    8
    Vote Rating
    0
    xpouj04 is on a distinguished road

      0  

    Default


    I have a TreeStore with proxy of type ajax. Then I do a call with additional params to change the tree based on id:


    myStore.load({params: {id: 'DS00001'}});


    but I do not pass a node - I expect that the tree is refreshed from the server JSON response. After the initial load correctly one request is sent, but after invoking load() method I have multiple requests being sent to the server as described above.. What did you mean by passing a node? Node object, or some text identification of what will be the root node from the response?

  4. #4
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    29
    Vote Rating
    2
    allardp is on a distinguished road

      0  

    Default possible fix

    possible fix


    Hi, I had the same problem, when trying to reload the whole tree based on another param. Indeed the bigger the tree, the more requests were sent (some were aborted, leading to invalid json etc etc)

    My solution was to do :

    Code:
    store.tree.root.removeAll()
    before executing the .load method of the store

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi