This document describes TreeGrid data sources for download and XML structure for download.
For basic information about TreeGrid communication settings (AJAX, AJAX SOAP, submit, direct) see Data communication with server.
For information about creating TreeGrid see Creating TreeGrid.
TreeGrid can download data from remote server, local server, local files or from XML placed directly in the source HTML page.
TreeGrid by default downloads from these basic data sources in this order: Text, Defaults, Base, Layout, Data.
The data source names and count can be changed by Source attribute.
It does not matter what setting is defined in which data source, but it is recommended to return data from the data source according to its meaning as described below.
If used server paging or reloading body the Data source can contain only variable rows definition (<Body> tag).
List of source names for download on start. It does not define the Page source and sources for upload.
The source name is used as prefix_ if defined by <treegrid> / <bdo> or object name if defined by TreeGrid() function.
';' semicolon separates layout and data sources. If no ';' is present, the last item is taken as data source. To distinguish layout and data sources is important for server paging and for ReloadBody API.
',' comma separates the sources loaded one by one, the second one starts loading after the first one is finished. Use if the order of loading is important.
'+' plus separates the sources loaded all at once. Use if the order of loading is irrelevant.
Data source to download all texts and language settings. It is loaded as the first data source.
By default it is set Text_Url="Text.xml" Text_Method="Get" Text_Static='Text' Text_Relative='1' to download the predefined TreeGrid texts from file Text.xml. The Text.xml file is searched in directory with GridE.js script.
You can translate and update the Text.xml for all languages you want and provide the appropriate file based on user language settings.
It is required source, but you can keep the default value "Text.xml".
Message displayed on grid initialization, when TreeGrid texts are loading.
Only if SuppressMessage is not set.
Since 7.0 its default value is "Initializing ...", so it is displayed by default. To hide only this message, set it to empty string.
In time of the message display TreeGrid styles are not loaded yet, so it uses internal message setting in the Standard style. To re-style this message, define GridMessage CSS class in page <head>.
The default message width is 140, it can be changed by Text_MessageWidth attribute.
It is always attribute of Text data source, even if the Text data source is not included in the Source.
Message displayed if TreeGrid texts failed to load and TreeGrid hangs.
Data source to download system predefined values of all parameters in TreeGrid. It is loaded as the second data source.
This file is required for TreeGrid to work properly. This file should not be modified and must be from the same version as GridE.js script itself.
By default it is set Defaults_Url="Defaults.xml" Defaults_Method="Get" Defaults_Static="Defaults" Defaults_Relative='1' to download the predefined TreeGrid values from file Defaults.xml. The Defaults.xml file is searched in directory with GridE.js script.
It is required source, but you can keep the default value "Defaults.xml".
Data source to download custom predefined values of some parameters in TreeGrid. It is loaded as the third data source.
By default is set Base_Method="Get".
It is optional source, to have some predefined values for all TreeGrids on site or in application.
Data source to download grid structure (configuration, columns, header, filter, group, search, fixed rows, pager, ...). It is loaded as the fourth data source.
By default is set Layout_Method="Get".
It is optional source, all the layout can be included in Data source instead.
It is required source for server paging and / or ReloadBody usage.
Data source to download grid data (variable rows or fixed data rows). It is loaded as the fifth data source.
It can contain also all grid data structure if Layout data source is not used (not possible for server paging or ReloadBody).
For server paging it should contain only pages definition (<B> tags).
By default is set Data_Method="Get" Data_Data="Data"
It is required source, you need to set at least this data source.
Data source to download data for individual page or child page. It is loaded on request, when the page is being displayed.
It can return only variable row within requested page. The requested page can be find out from request configuration XML sent in Data parameter.
By default is set Page_Method="Form" Page_Data="Data".
Used only for server paging or server child paging.
Can be used only with AJAX communication, set attribute Page_Url.
It is required source for server paging or server child paging.
For other paging types is not used at all.
Base path to all TreeGrid base files required files: Defaults.xml, Text.xml, Grid.css, Gantt.css, Help.html.
The default value is the path to GridE.js file, it is usual to place all the required files along to the GridE.js.
The BasePath is add also to <treegrid Defaults_Url and Text_Url>, but not to <Cfg CSS and HelpFile/>.
It must end with '/' if contains standard directory path.
Called before data are requested by any method (AJAX, submit, ...) from source Defaults, Text, Base, Layout or Body.
source is the data source that is accessed, for example grid.Source.Layout. The source.Name contains the name of source, e.g. "Layout".
It can return true to suppress the loading and provide the downloading by custom way and must call function Func (int result), where result<0 is error code or 0 for ok.
Reads data from given source according to its _Url/_Tag/_Data parameters.
source is the data source to be is accessed, for example grid.Source.Layout.
After finish calls function Func: function Func (int result), result<0 is error code and >=0 is success.
It is set to 1 during downloading and updating base data - when creating grid, reloading grid, or reloading body of grid.
When Loading is set, no API function that reads or changes grid data can be called.
Called after all data has been loaded successfully, when creating or reloading grid.
It is called before the grid data has been updated, so you cannot call any row or column manipulation function.
Since 10.0 you can return true to not continue, if required some asynchronous action. And after finish call next( ) to continue.
Called when data cannot be downloaded and the grid cannot render and shows fatal error.
There is always called OnLoaded or OnLoadError event.
Called after all grid data were prepared for use, but before the grid calculated, filtered, sorted, grouped and rendered.
Here you can call any data manipulation API methods to update the data before they are calculated and sorted/grouped/filtered.
Called after all grid data were prepared for use, before the grid is rendered.
It is called when creating or reloading grid (start = 1) or when reloading body or updating detail grid (start = 0).
Here you can call any data manipulation API methods to update the data before they are rendered.
It is the only time during grid creating when both the Loading and Rendering properties are false. Do not call here API methods that render grid or update grid view!
How long TreeGrid waits for its CSS style (Grid.css and Gantt.css files) to be completely loaded, in seconds.
If the timeout expires, TreeGrid shows fatal error.
You can prepare input xml data for grid to speed up loading grid. If input xml data are prepared, set in them Prepared to 1.
Date type values must be set as count of milliseconds from 1/1/1970 00:00:00.000, see also GMT attribute.
Float values must be set in standard English format, without leading zero, but with leading zero for values between -1 and 1.
All Int, Float and Date type cells must have set its value (or set value in its default row cell).