Categories | Question details Back To List | ||
TreeGrid performance I'm trying to get a TreeGrid to load quickly with thousands of records. My source URL returns XML data almost immediately even though the browser will continue to spin for minutes since the result is very long. Is there any way to get the treegrid to display with data as soon as it has a few dozen rows to show on the grid? I need all the parent rows expanded when the user scrolls through the grid. I only have one child level under the parent. So dynamic loading of kids doesn't seem to work for me. SmartRendering certainly helps with scrolling speeds but doesn't draw the grid until the entire XML doc is loaded. SmartXMLParsing doesn't seem to help much nor does DistributedParsing. There has to be some way to tell the grid to draw with the records it has and async the rest. Answer posted by Support on Nov 06, 2008 02:19 >> with thousands of records Can you provide exact size of dataset ( count or rows and columns ) ? In normal case smartRendering mode works in the necessary way - it renders only visible part of data only, not processing invisible part of dataset. >>I need all the parent rows expanded when the user scrolls through the grid. Which logic you are using to expand rows? The most fast solution would be to have "open" attribute for related row(s) in XML. >>but doesn't draw the grid until the entire XML doc is loaded The parser need to load whole document before starting any opearation, so rendering will start only after data will be loaded on client side and browser will parse incoming XML ( the parsing is quite fast, and must not be the reason of performance issues ) Answer posted by Jerry on Nov 07, 2008 08:08 So I guess there isn't a solution. If I set the expanded flag to open in the XML, the XML must include the kids, right? Since the grid cannot begin rendering without waiting for the entire XML response to finish, it doesn't matter how fast my server side starts returning data, only how long it takes to transmit the data to the client. Is there anyway to use dynamic loading in a tree grid with the parents expanded? In other words, if I set the expanded flat to open in the XML, is the grid smart enough to know which kids it needs based on the viewable grid area and retrieve only those kids whose parents are visible? There would not be an event on clicking the plus in this situation. The grid would have to grab kids based on the scrolling event.
Answer posted by Support on Nov 10, 2008 09:49 >>the XML must include the kids, right? Yes, if you want to show branch in initially expanded state it must contain data for all child items. >>Since the grid cannot begin rendering without waiting for the entire XML response to finish, it doesn't matter how fast my server side starts returning data, only how long it takes to transmit the data to the client Technically you can use a next code grid.load("small.xml",function(){ grid.load("big.xml"); }); And in big XML , have a <rows> <head> <afterInit><call command="clearAll"></call></afterInit> </head> ... data ... In such case grid will load small portion of data and start loading of full dataset, which will replace existing data on-loading. >> Is there anyway to use dynamic loading in a tree grid with the parents expanded Nope. The grid in SRND mode need to know count of child elements to render itself correctly. So while it possible to use SRND and dyn. loading with closed branches, the same will not work for expanded branches. >> is the grid smart enough to know which kids it needs based on the viewable grid area and retrieve only those kids whose parents are visible? Willl not work. Grid still need to kwow structure of hierarchy to be able to convert a position of scroll to the row indexes |