DHTMLX Docs & Samples Explorer

Dynamic loading

By default component loads all data at once, but it possible to configure it , so data will be loaded on demind ( this mode can be used with paging to organize dynamic paging, or without it )

Dynamic loading can be organized wiht XML and JSON datasources only.

The inital response from server must contain top level “total_count” parameter, which will contain info about expected count of items in the dataview. Each next request must contain “pos” value , with info about index of first record in the set.

For XML

<data total_count="5000" pos="0">
    <item ...

For JSON

{
    total_count:5000,
    pos:0,
    0:{ data object here },
    1:{ data object here }
}

There is no need to extra commands on client side, presense of total_count parameter will be enough to trigger dynamic loading.

You can define separate template which will be used for not loaded yet items

    view = new dhtmlXDataView({
	container:"data_container",
	type:{
            template:"#Package# : #Version#<br/>#Maintainer#",
            template_loading:"Loading..."
        }
    });