Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dmitry on Mar 10, 2008 21:52
open dhtmlx forum
Faster loading TreeGrid

Hello!

How can i faster loading of treeGrid kids branches?

how to use mygrid.setXMLAutoLoading?

could i make like

    mygrid.attachEvent("onRowSelect", function(id)
                        {
                            //alert("onRowSelected " + id);
                            LoadXML(id);
                            return true;
                        });

it is strange but it doesnt work well - branch doesnt load. Could i on one click just load kid tree without opening?

Are there another ways to faster loading.
Answer posted by Support on Mar 11, 2008 02:16
This approach can be used. But the xml, which you load when "onSelectRow" event occur, should be correct.

For example when you select node with id = "id_1", the xml should be as follows:

<?xml version="1.0" encoding="UTF-8"?>

<rows parent="id_1">
    <row id="...">
        <cell>..</cell>
      ...
    </row>
...
</rows>
Answer posted by Dmitry on Mar 11, 2008 02:24
My xml is allright because on double click or on plus click branches opened well.

How to use setXMLAutoLoading? What is it params?
Answer posted by Support on Mar 11, 2008 02:48
setXMLAutoLoading method doesn't work with TreeGrid.

You should use kidsXmlFile property for dynamic loading.

If you don't want that items will be opened after loading, you can try to use the following approach: 

 grid.kidsXmlFile="grid.php";

 grid.loadXML("grid.php");

 grid.attachEvent("onRowSelect", function(id){

    grid.loadXML("grid.php?id="+id,function(){

        grid.closeItem(id);

    });
    return true;
 });
Answer posted by Dmitry on Mar 11, 2008 02:54
At now i use xmlKid property. But i want to faster opening similar setXMLAutoLoading. That not opened branches load while user work with opened.
Answer posted by Dmitry on Mar 11, 2008 02:55
it is strange but in the documentation there are description of SetXMLAutoLoading

setXMLAutoLoading(filePath,bufferSize)
enables the possibility to load content from server when already loaded content was rendered. Using this feature you decrease the grid loading time for extremely big amounts of data ( in case of latest grid version, usage of SmartRendering instead of this mode strongly recommended )
Object: dhtmlXGridObject
Topic(s): overal control;
File required:dhtmlxgrid.js
filePath - path which will be used for fetching additional data
bufferSize - size of client size buffer

Answer posted by Dmitry on Mar 11, 2008 02:56
Documentation for treegrid/API functs/alph sorted
Answer posted by Support on Mar 11, 2008 04:38
>>But i want to faster opening similar setXMLAutoLoading
setXMLAutoLoading allows to load additional data in paging mode ( or can be used to autoload data on scroll ) it is purposed to be used in case of plain grids, while, technically it possible to use it in case of treeGrid - it will require pretty complex code to maintain client and server side data in sync )
There is no any performance benefits between setXMLAutoLoading and kidsXmlFile

>>it is strange but in the documentation there are description of SetXMLAutoLoading
TreeGrid is an extension of Grid, so it nested such functionality , and it can be used for plain view