The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

[CLOSED] TreePanel load via onDocumentReady

  1. #1

    [CLOSED] TreePanel load via onDocumentReady


    Please review this example:

    Simply set the store to be onload="false"

    Then in the ResourceManager, set an onDocumentReady Javascript handler and call App.TreePanel.getStore().load

    I didnt use this example but in my code, the JS load fails to load anything. but if we set the store to autoload=true, it works.

    can you please review? the change to the example should be trivial to test.

    Last edited by fabricio.murta; Jun 04, 2018 at 10:08 PM.
  2. #2
    Hello @Z,

    The example you pointed does not fit the scenario you asked us to try to reproduce. It does not run the load operation at load-time at all. It only loads sub nodes as they are expanded, so the first load call is made when the 'root' node is expanded, not when the page loads. The root node is statically defined in the grid.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello again @Z!

    Just a follow-up that I realized as soon as posting the answer above, maybe all that you need to bind your document ready (or grid panel render) event is to expand the root node, in order to trigger the load proxy call.

    Something like this within your tree panel definition should do:

    .Listeners(l => { l.AfterRender.Handler = "this.getStore().getRootNode().expand();"; })
    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  4. #4
    that did it!
    Since i had a hidden static root node, i just needed to expand that hidden root node and that automatically loaded the store.
    Last edited by Z; Jun 04, 2018 at 8:53 PM.
  5. #5
    Hello @Z!

    Thanks for the feedback, glad it helped!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: Jul 12, 2013, 10:07 PM
  2. Replies: 0
    Last Post: Feb 21, 2013, 7:26 PM
  3. [CLOSED] Stop treepanel to load data on page load
    By inayath in forum 1.x Premium Help
    Replies: 1
    Last Post: Feb 11, 2011, 10:17 AM
  4. [CLOSED] [1.0] Treepanel AsyncTreeNode load
    By juane66 in forum 1.x Premium Help
    Replies: 5
    Last Post: May 24, 2010, 7:41 AM
  5. TreePanel - load root with loader
    By pintun in forum 1.x Help
    Replies: 2
    Last Post: Apr 14, 2010, 8:19 PM

Posting Permissions