News in version
TreeGrid Gantt chart SpreadSheet Examples Documentation Download Development Licensing Prices References Contacts Buy Try it free
Documentation
Search in documentation
TreeGrid versions compatibility

Changes log (txt file) Using custom CSS from 13.3 to 14.0 Upgrading from 9.3 to 10.0 Upgrading from 5.9 to 6.0

Using in JavaScript frameworks

Angular Ember Express React Svelte Vue Other frameworks NodeJS server SalesForce LWC

Creating grid

Simple examples Basic information Creating grid Deleting grid Reloading grid Rendering grid Accessing grid by API

Data & communication
Data communication with server

Communication types AJAX communication AJAX SOAP envelope Submit communication Directly included data Data from JavaScript Cross domain / local load by JSONP Sessions (AJAX) Server response (AJAX) Synchronous communication (AJAX) Caching (AJAX) API (AJAX)

Download data

Settings for data download Layout XML structure Data XML structure

Upload data

Settings for data upload API for upload XML structure sent to server

Changing data from server

XML structure of download changes XML structure of request for a cell Synchronizing data with server

Input / output data formats

Complete list of tags Internal XML format Short XML format Extra short XML format DTD XML format JSON format

Cells
Cell basics

Cell type Cell format Dynamic format Dynamic type Cell value Reading / writing attributes by API Cell HTML Cell default Range or more values in one cell Cell with link URL Cell hint Cell tooltip / title Cell popup menu

Cell editing and changing values

Cell editability Dynamic editing Locking Defaults list Suggest list (auto complete) Tags input Changing cell value Mass cell change Clearing cells Editing cells Controlling <input> tag by JavaScript Input validation and restrictions Side checkbox Cell selecting

Calculations - cell formulas

Basics Formulas Mathematical functions Aggregate functions Special functions for actions Custom functions

Calculations - editable cell formulas

Basics Suggest list (auto complete) Defined names Actions for choosing cells Conditional functions Lookup functions Cell reference functions Logical functions Informational functions Mathematical functions Trigonometry functions Rounding numbers Number conversions String functions Date functions Summary functions Custom functions

Cell side buttons

Introduction Right side Button Left side Icon

Cell spanning

Column span Row span Dynamic spanning

Cell style and color

Basic grid style Sizing and scaling - responsive design Dynamic cell style attributes Cell CSS class Cell background color Dynamic cell border Cell HTML style Row color alteration Cell mouse cursor

Editable cell images

Insert image Edit image

Cell types
Automatic type - Auto String - Text, Lines & Pass
Number - Int & Float

Format Localization

Date and time - Date

Format Calendar component Dates dialog Localization

List & combo - Enum & Radio

Introduction Definition Related lists Enum specific Radio specific

Checkbox - Bool
Action button - Button

Introduction Basic clickable button Switch button Radio / tab button Menu button Combo switch button Combo radio / tab button Special Space rows with buttons

Panel with more buttons - Panel

Definition Standard fast panel Custom panel

HTML and special types

Html type EHtml type (editable) Icon type Abs type List type Editable Link type Editable Img type DropCols type Upload File type

Columns

Column basics Column index Column visibility Column visibility menu Column selecting Column tree Auto column tree Column position and moving Column adding and copying Column deleting Column width Column API

Rows
Row basics

Rows by functionality Rows by position Row name Row id Row index

Default rows

Description Example of default rows Example of changing default row Attributes

Row tree

Tree attributes Actions & API for expand / collapse

Row identification

Setting row id attribute Row id attribute in tree Row id created from cell values API for row ids

Row visibility
Row adding and copying

Five ways of adding rows to grid Adding and copying restrictions Adding new empty rows Copying existing rows

Row deleting Row moving and dragging Row selecting Row height Row API Space rows
Features
Sorting rows

Sort settings Controlling sort position Comparing strings Sorting actions Sorting API

Grouping rows to tree

Group settings Creating groups Comparing strings Created group rows <D Group='1'/> User interface to choose grouping Grouping actions and API

Filtering rows

Filter settings Comparing strings User interface to choose filter Filter actions and API

Searching in rows and cells

Search settings User interface for search Search actions and API

Printing grid

Print settings Choosing items to print Page size Print API

Print / export to PDF

Introduction Client side settings Printing options Client side API Server side API Data sent from client to server

Export to Excel or CSV

Introduction and export types Basic settings Styling export XLSX export Gantt export CSV export Old XLS / XHTML export Export API Communication with server Client export Server export

Import from Excel

Basic settings Sheets manipulation

Copy & paste rows via clipboard

Copy & paste permissions Copying to clipboard Pasting from clipboard

Master - detail grids

Introduction External master - detail grids Nested master - detail grids Synchronizing grids Other attributes for master - detail

Pivot tables

Pivot attributes & API Pivot formulas

External objects (custom JavaScript objects) Undo & Redo
Gantt and bar chart
Gantt objects

Gantt objects list Display settings Edit settings

Main bar

Definition of main bar and plans Main bar as Task Edit settings Main bar content and side html Tip on mouse hover Vertical position and height Style specific attributes API to manipulate Main bars Actions Side text (deprecated) Real Flow (deprecated)

Run bar

GanttRun Definition Extended definition Run bar as Task Edit settings Save format Selecting Run boxes Run box content and side html Tip on mouse hover Box identification Vertical position and height Style specific attributes Overlaid (Error) boxes Containers for more boxes Dragging - moving and resizing API to manipulate Run boxes Actions Run special formulas

Summary task

Main for Main Main for Run Editable Main Editable Run

Gantt icons - Flag & Point

Flag - icon with text Point - math points

Gantt display objects

Header - column captions Cell and column Background Vertical movable Line Mark & Progress line

Gantt zoom

Zoom options Chart size limits Zoom selection Paging in Gantt chart

Dependency, constraints & schedule

Introduction Data units Defining dependencies Dependency colors and shapes Changing dependencies Correcting dependencies Scheduling algorithm Project date constraints Task date constraints Critical path - Slack (Float)

Gantt calendars

Global base calendar Local calendar Calendar list Calendars dialog Other settings

Gantt resources

Resources list Resources assign Resources filter Resources calculations Availability chart Resource usage chart Generated resource usage chart

Gantt popup menu Gantt API
Line and XY points charts

Charts in grid cells Chart JSON definition Base chart settings Basic attributes Size Axis and caption Individual chart lines Data sources Visual settings API for standalone usage

Paging in large grids
Paging root rows

Paging types and attributes Auto adding root pages API for paging

Pager components

Side pager Side pager type Pages Side pager type Gantt Side pager type Custom Pager with navigation buttons & edit Pager as list of page indexes

Paging in tree

ChildPaging - load / render on expand MaxChildren - limit children count ChildParts - load / render on scroll

Paging columns

Paging types and attributes Auto adding column pages API for column paging

Server paging

Server paging for root rows Server communication in root paging Root paging in very large tables Server paging in tree Server communication in tree paging XML Request for Data in root paging XML Download Data in root paging XML Request for root Page / children XML Download root Page / children API for server paging

TreeGrid DLL/SO for server paging

Introduction Compatibility with TreeGrid control Using TreeGrid server DLL/SO ASP.NET C# ASP.NET VB PHP JSP Java TreeGrid server concepts Function reference Calculations

JSON menus and dialogs
JSON menu description JSON menu definition example
Menu settings

Base attributes Visual settings Key navigation Behavior Size and scroll

Menu item settings

Base attributes Clickable item Inactive caption Collapsible sub level Popup sub menu Columns Bool item Enum item Edit item

Custom menu in JavaScript

Show custom menu Custom menu position Custom menu advanced settings Custom menu JavaScript events Custom menu JavaScript methods

Calendar dialog Custom calendar & JavaScript events Custom dialog in JavaScript
Global grid settings
Grid size and scroll

Default behavior Maximize grid height and width Update size according to the content Let a user to control the grid size Widths of individual sections Other scrolling attributes and API

Media rules - responsive design
Languages

Language & regional setup (Text.xml) Translate texts dynamically Change language

Grid cursor - Focus & hover

Focused cell and row Focused cell range Move and copy focused cells Filling cell values by dragging Tabulator navigation Key navigation Cursor look - focus & hover

Selecting rows, cells and columns

Selecting base Selecting rows Selecting cells Selecting columns

Global settings

Status messages Configuration menus Configuration menu - options Configuration menu - columns Configuration menu - print / PDF Configuration menu - export Default toolbar Useful API function Help file

Animations

Animations base Row animations Column animations Cell animations Animations for undo / redo Animations for server side changes Dialog animations

Grid configuration in cookies
Mouse & key events & actions

List of event handler types TreeGrid mouse events Mouse event names Key and mouse button prefixes Touch event names Event targets Assigning event actions / callbacks Event action parameters Action name suffix Calling actions from JavaScript Creating custom actions Focused vs. Actual cell TreeGrid key events JavaScript API events

Mouse API event TreeGrid files
Debugging and testing

Debug window Automated testing

Changing data from server

TreeGrid documentation

XML structure with downloaded changes

Data sent from server to grid. It is generated by server script.
Used to change the rows and their cells one by one from server side.
Used when downloading changes done on server after uploading (from Upload source) or checking for updates (from Check source) or downloading cell (from Cell source).
Used as response from data sources Upload, Check, Cell.

Only these row attributes are supported:
Deleted, Added, Moved, Changed, Parent, Next, Prev
Def, Color, AlternateColor, Class
CanEdit, CanFocus, CanDelete, CanSelect, CanExpand
Visible, Selected, Expanded, Menu
Calculated, CalcOrder
Height (since 14.0)

Only these cell attributes are supported:
value
Class, Color, HtmlPrefix, HtmlPostfix, Visible
CanEdit, CanFocus
Type, Range, Format, EditFormat, ExportFormat, EditMask, ResultMask, Size
Button, ButtonText, Defaults, Suggest, SuggestType,
Enum, EditEnum, EnumKeys, IntFormat, Related Refresh, Clear,
Tip, ToolTip, Error, Selected, Formula, Menu, CopyTo

Since 12.0 also attributes set in EditAttrs are supported

To change id attribute of existing row, return it in NewId attribute.
chg 9.0 upd 16.4 <Changes> int

Update

[1]
What to update after rows are changed/added/deleted/moved. Binary array.
1.bit (&1) - accepts row changes. The row is displayed as unchanged (all the change flags are removed, Deleted rows are removed).
Since 9.0 for Update=1 it does not accept other pending changes in the row, use Update=17 to do it.
2.bit (&2) - reserved (since 9.0 it always recalculates the rows)
3.bit (&4) - filter row. works only for StandardFilter=0
4.bit (&8) - search row (only Select or Mark actions)
5.bit (&16) - accept all pending changes before processing the <Changes> tag.
Use this setting in Upload_Response to accept the old changes and create new not saved changes.
The response should return also return negative <IO Result/> to not accept changes later.
6.bit (&32) - (new 9.3) does not refresh the change cell(s). Usable for changing edited cell from server side.
7.bit (&64) - (new 12.0) searches updated row id against RowIndex instead of row id. Not for Added, Moved and Deleted rows.

8.bit (&128) - (new 12.0) adds new pages due AutoPages if the updated row does not exist.
9.bit (&256) - (new 13.0) animates all changes done from server side, see Animations for server side changes.
10.bit (&512) - (new 16.4) merges GanttRun values in Changed rows. Adds new boxes to the end of existing run by AddGanttRun
new 9.0 <Cfg> int

ChangesUpdate

[1]
Default value for Update used if <Changes Update/> is not set.
It can be used also in JSON format, because the <Changes Update/>attribute is not available in JSON.
new 14.0 <Changes> int

Added

[0]
What to do when adding row that already exists in the grid.
0 - Update the old row with attributes from new row
1 - Delete old row and add the new row
2 - Discard adding the new row and preserve old row
3 - Add new row with newly generated id
4 - Generate new id for the old row
new 14.0 <Cfg> int

ChangesAdded

[0]
Default value for Added used if <Changes Added/> is not set.
It can be used also in JSON format, because the <Changes Added/>attribute is not available in JSON.
<I> string

id

Both letters lowercase!
Unique ID of the row to change or new ID for the added row.
<I> string

NewId

New id for the row when it is modified by <Changes> tag.
API event void

OnUpdateRow

(TGrid grid, TRow row, TRow update)
Called after the row is updated or added from server side.
The update is virtual row with the changes applied to the row. The update is a node from <Changes> tag.
Can be used to refresh changed row or provide some custom changes according to custom settings in the update.

<Grid> (Root tag, can accept any count of introduced child tags in any order)

<IO ... attributes ... /> (a server response)

<Changes Update='1' > (list of changed rows)
<I id='...' ... some row and cell attributes ... />
... More tags <I> ...
</Changes>
</Grid>

XML structure with request for a cell

Used as request sent to data source Cell.
It is used to download Defaults list dynamically from server (when set DefaultsServer='1'), before the list is expanded.
It is used to download cell settings dynamically from server (when set EditServer='1'), before it is edited.
It is used to download Suggest list dynamically from server (when set SuggestServer='1'), whenever cell value is changed while editing it to update the suggest list.
<treegrid,bdo> string

Cell_Url

An URL to download changes from server for given cell before defined action happens.
Used to download:
Defaults list when set DefaultsServer='1'. Called before the list is displayed on click to the Defaults button.
Suggest list when set SuggestServer='1'. Called during editing whenever user changes the input value to get new list for suggested values.
Edit settings when set EditServer='1'. Called before editing started.
The XML request has format like <Grid> ... <Body><B id='row_id' Col='column_name' Val='cell_value'/></Body></Grid>
The returned data should be like other server returns in <Changes> tag.

<Grid>

<IO ... attributes with request settings ... /> (Session attribute)
<Cfg ... attributes with grid settings read from cookies ... /> 
(Sort, Group, ReSort, ReCalc, TimeZone attributes)
(SearchAction, SearchExpression, SearchType, SearchMethod, SearchDefs, SearchCols attributes)
(Focused, FocusedCol, FocusedPos attributes)
<Filters> (list of filters)
<I ... row and cell attributes ... /> (id attribute, cell values and cell Filter attributes)
... More tags <I> if more filters are in grid ...
</Filters>

<Body>
<B ... attributes identifying the cell ... /> (id attribute, Col attribute as column name, Val attribute as the cell value)
</Body>

</Grid>

Synchronizing data with server
(periodical check / server push / long polling)

With TreeGrid you can do client data synchronization with server. When server gets some change from another source (e.g. another client), TreeGrid automatically downloads the changes and updates its data on client.

Set Check_Url to server script url that will return all changes (in <Changes> tag) done on server from the last access to the Check_Url.
You can set also other attributes with Check_ prefix (like Check_Method) to control how the communication will be done.
There are two usual methods of synchronization, periodical check and long polling.

a) Periodical checking
Set Check_Interval to some interval (in seconds) and TreeGrid will periodically download changes from Check_Url.
When no changes have been done since last call, server will just return empty response.

b) Long polling (simulates server Push technology)
This method provides immediate response, the changes on server are immediately downloaded to client.
Set Check_Interval='1' and Check_Timeout='0' and TreeGrid will periodically and immediately download changes from Check_Url.
When no changes have been done since last call, server will not return anything and let the HTTP connection open until some changes arrive.
You need to permit the long polling on your server, increase the connection timeouts.
You can also set Check_Repeat="3" to resend the request automatically when server closes the connection due its timeout.
<treegrid,bdo> string

Check_Url

If set, TreeGrid periodically checks this URL and downloads changes from server (if any) and add them to TreeGrid.
<treegrid,bdo> string

Check_Timeout

[0]
How long will the grid wait for response, in seconds.
0 means forever, use especially for long polling.
<treegrid,bdo> string

Check_Interval

[5] Saved to cookies, to not load it set CheckIntervalLap='1'
How often grid will check for updates on Check_Url. In seconds.
This value can be modified by a user from configuration menu.
<treegrid,bdo> string

Check_Repeat

[3]
What to do if server returns an error.
0 - alerts the problem to user ("Synchronizing with server failed!"), and disables the Check_Interval='0'
1 - does not alert anything to user, just disables the Check_Interval='0'
2 - alerts the problem to user ("Synchronizing with server failed! Do you want to temporary disable the checking for updates?") and let him to choose.
3 - Automatically repeats the attempt
API method void

CheckForUpdates

(function Func)
Checks for updates on server at Check_Url and downloads them if any. Calls Func after finish.