1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    52
    Answers
    2
    Vote Rating
    0
    Ghurdyl is on a distinguished road

      0  

    Default Answered: Unwanted auto load

    Answered: Unwanted auto load


    Hello,

    I am trying to have a tree grid that does not load at render time but later on ; like after clicking a button.

    Sounds easy but can't achieve this.

    If someone could let me know how to do this on the tree grid example in the doc I'd be thankful.

    Tanks for any hint.

  2. Ok

    So no any other way to prevent tree loading.
    I actually need to render it as the data request needs an information held by a checkbox item of the tree's toolbar menu. (and the checkbox is stateful, cannot anticipate it's value)

    So, it's maybe not very elegant but I have listened for the store's beforeload event and I return false while it's not ready to load according to my needs.

  3. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Answers
    102
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Just don't render the tree panel until you need it. Else, you can try to setup the tree panel with an empty store.

  4. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    52
    Answers
    2
    Vote Rating
    0
    Ghurdyl is on a distinguished road

      0  

    Default


    Ok

    So no any other way to prevent tree loading.
    I actually need to render it as the data request needs an information held by a checkbox item of the tree's toolbar menu. (and the checkbox is stateful, cannot anticipate it's value)

    So, it's maybe not very elegant but I have listened for the store's beforeload event and I return false while it's not ready to load according to my needs.

  5. #4
    Ext JS Premium Member
    Join Date
    Sep 2007
    Location
    CT
    Posts
    462
    Answers
    1
    Vote Rating
    2
    ValterBorges is on a distinguished road

      0  

    Default options

    options


    • You can swap out stores.
    • You can change the query parameters that get submitted to the proxy so that it loads empty / no results first time and on some event set different parameters and then load the store again.
    • function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}

  6. #5
    Ext JS Premium Member
    Join Date
    Sep 2007
    Location
    CT
    Posts
    462
    Answers
    1
    Vote Rating
    2
    ValterBorges is on a distinguished road

      0  

    Default store autoLoad:false

    store autoLoad:false


    If you set the store to autoLoad:false on a tree are you saying it's still loading?

    If so I would consider this a bug, imho it should obey the store setting.

  7. #6
    Sencha User
    Join Date
    Jun 2010
    Posts
    52
    Answers
    2
    Vote Rating
    0
    Ghurdyl is on a distinguished road

      0  

    Default


    Thanks for all those replies,
    • You can swap out stores.
    If I don't define any store for the tree, it does not apreciate ant send me to hell
    • You can change the query parameters that get submitted to the proxy so that it loads empty / no results first time and on some event set different parameters and then load the store again.
    Very bad idea, I think because the ajax query will be done and consumes resources for nothing.
    • If you set the store to autoLoad:false on a tree are you saying it's still loading?
    setting autoload to false was the very first thing I tried, but it loads anyway.