Results 1 to 3 of 3

Thread: [SOLVED] TreePanel: How to load all data in one AJAX request?

  1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    84

    Question [SOLVED] TreePanel: How to load all data in one AJAX request?

    Hello,
    I'm trying to master the TreePanel object, but I didn't find how to load all the data of the TreePanel in one request.
    It's embarrassing because I need to browse this data through many levels, so with the actual loading mode I need to do many request, one by sub-level and it's not acceptable.

    Can someone can help me for this issue ?

    Thank you!

  2. #2

    Default Okay

    1) Look at the TreeLoader class.

    2) Create a TreeLoader object with all the custom stuff you want. You might want a 'beforeload' handler to set a few custom parameters, etc. (node types and id's):

    For example, in one of my apps, my tree has a click/expand handler on it to detect the selected node. Then I have a 'beforeload' handler in my TreeLoader that sets any 'selected node' information necessary to retrieve the relevant records.

    3) Create the Tree and pass the TreeLoader object to it.

    4) Enjoy.
    Last edited by rbastic; 1 Mar 2010 at 11:50 AM. Reason: further explanation

  3. #3
    Ext User
    Join Date
    Jun 2009
    Posts
    84

    Thumbs up

    Thank you! I set all the children in one response, and now it does only one request to retrieve all the records. It's exactly what I needed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •