Treepanel: expand ~1500 nodes gives error

  1. #1

    Treepanel: expand ~1500 nodes gives error

    Hi,

    I´m fighting with this for 2 days now...
    In a Treepanel, I´m loading nodes via a Treeloader. The data contains about 20 top-level nodes but with about 1500 subnodes in up to 10 sub-levels. At the initial loading, of course not all nodes are retrieved. Problem is that it should be possible to expand each and every node (which does not make sense IMHO, but my opinion doesn´t count). When trying to execute myTreepanel.ExpandAll() in codebehind, I immediately see many error messages in the VS output window saying "A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Web.dll", while nodes get expanded in the UI. After some seconds, the browser shows a gray masked windows (Title: "Request Failure", Text: "Status Code: -1, Status Text: transaction aborted").

    Doing this for a smaller amount of nodes does not face this problem. I suspect that the webserver is flooded with too many requests to load the nodes that should be expanded. Is there a way to restrict the amount of concurrent requests or even to send the next "Expand"-request after the previous one is finished?

    Currently I´m doing the coding in the code-behind file but if necessary, I will put it the markup file.

    Many thanks in advance,
    Rob
  2. #2
    I can suggest to clear tree when you want ExpandAll and reload root node, reloading request should return whole tree in that request
  3. #3
    Thanks Vladimir, that points me in the right direction.
    I was not aware that the TreeHandler (which was not written by myself) did not return _all_ nodes recursively.
    If I understand correctly, after loading all nodes the ExpandAll() function will not force the TreeHandler to load nodes again because it knows that they are already present, which finally causes just the visual expansion of all nodes. Is that true?

    Thanks,
    Rob
  4. #4
    There are two node types: TreeNode and AsyncTreeNode

    If AsyncTreeNode doesn't load children yet then before expand it will initiate request to get children
    TreeNode doesn't initiate any request

    So, you handler must return TreeNode with children if you want to get all nodes

Similar Threads

  1. Replies: 0
    Last Post: Nov 16, 2011, 10:07 AM
  2. [CLOSED] select node and expand parent nodes
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 13, 2011, 12:06 PM
  3. Replies: 1
    Last Post: Nov 17, 2010, 12:42 PM
  4. [CLOSED] Treepanel How to Highlight certain Nodes
    By dheeraj_us in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 13, 2010, 6:06 AM
  5. How to expand all child nodes for current node?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: May 26, 2009, 2:53 PM

Posting Permissions