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 React Vue Other frameworks NodeJS server

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 (like Adobe Flash) 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

TreeGrid files

TreeGrid documentation

All required files are in one directory. In default distribution is this directory "Grid\".
All files can be moved or renamed, but these changes must be registered. For every file is noted, where you have to do the changes.
By default you must preset location for main script file GridE.js. All other files are by default searched in the same directory as GridE.js.
All files may be modified except GridE.js.
upd 15.0 required JS

GridE.js

/Grid/
Main JavaScript code. You must include reference to this file in <head> section on HTML page.
<script src="../Grid/GridE.js"> </script>
To ensure the newest script is loaded, add some version parameter to it like <script src="../Grid/GridE.js?v11_0"> </script>
Since 14.1 you can include GridED.js short script instead to download the main GridE.js script on demand only.
It is forbidden to modify the GridE.js  file!
Remember, all other required files are searched by default in the same directory as the GridE.js file.

(Since 15.0) If purchased TreeGrid source codes, it is possible to compile GridE.js including all required files to create standalone script without any loading of other TreeGrid files.
It is possible to include Defaults.xml/js, Text.xml/js, language TextXX.xml/js files, JSZip JavaScript file(s), canvg script and responsive CSS style files. And also any xml/json layout / data files.
Description how to do it is in the compiler ini file.
new 14.1 conditional JS

GridED.js

/Grid/
Renamed and updated from GridEOnDemand.js.
Short script that can be included instead of main GridE.js script to load the main script GridE.js on demand only.
It must be placed in the same directory as GridE.js and both the GridE.js and GridED.js files must not be renamed.
It loads the GridE.js file automatically when:
a) The page contains some <treegrid> / <bdo> tag on the page load or on load the GridED.js.
b) If called global function: TreeGrid(), StartTreeGrid(), PrintTreeGrid(), TGSetEvent(), TGAddEvent(), AddGanttUnits()
The Grids object can be used to define API events normally before the GridE.js is loaded.
Also GetGrids, TGGetEvent and TGDelEvent global functions can be called before the GridE.js is loaded, although they have no effect.
No other TreeGrid global API functions like DateToString, ShowMenu or AjaxCall can be called before GridE.js is loaded.
Check global window.TGComponent to know if the GridE.js is already loaded.
If used, the TreeGrid() and PrintTreeGrid() functions return grid object not yet initialized only with Source attribute set.
GridED.js script should not be used with PrintTreeGrid() if the function is expected to be synchronous, e.g. when printing to PDF.
To load GridE.js manually is possible by calling LoadGridE (path, func) function.
The path is url of GridE.js file like "../Grid/GridE.js". The path can be relative to the main page url as usual or can be absolute.
For empty path is used the path to the GridED.js if exists. Check the script path carefully, the most errors are caused because of wrong path.
The LoadGridE is asynchronous function, set func to be called after the script is loaded.
Deleted 14.1 JS

GridEOnDemand.js

/Grid/
Renamed and updated to GridED.js.
new 14.1 conditional JS

GridEStandalone.js

/Grid/
Sample of TreeGrid bundle. It can be included instead of main GridE.js.
It is standalone file containing all TreeGrid required files, it does not load anything from server except the application data and layout.
This sample bundle contains Default.xml, Text.xml, all language files, CSS style Standard for grid and dialogs, CSS style White for Gantt, JSZip, canvg.
The GridEStandandalone.js can be loaded also by GridED.js if renamed to GridE.js.
If purchased TreeGrid sources it is possible to compile any such bundle containing any data files or styles or even application layout and data xml/json files.
required XML

Defaults.xml

/Grid/
Data source file with predefined values for all required TreeGrid parameters, for all grids.
This file should not be changed to avoid problems with upgrading to new TreeGrid version.
To predefine default values for all your grids use Base data source.
Path and name and/or place you can change in <treegrid>/<bdo> attribute prefix Defaults_.
This file can be loaded as static file or can be generated by web page or service or can be included in HTML page.
Since 15.0 If the data sources contain only .js / .json files or Json attribute is set, there is loaded Defaults.js instead of Defaults.xml.
See the Defaults.xml content
new 15.0 conditional JSON

Defaults.js

/Grid/
Defaults version in JSON format. It contains the same values as Defaults.xml.
It is loaded instead of Defaults.xml if the data sources refers to .js / .json files or if Json attribute is set.
See the Defaults.js content
required XML

Text.xml

/Grid/
Data source file with all TreeGrid texts and messages and language dependent constants for formatting numbers and dates.
Path and name and/or place you can change in <treegrid>/<bdo> attribute prefix Text_.
This file can be loaded as static file or can be generated by web page or service or can be included in HTML page.
This file is for English language.
You can translate this file to any other languages and also return appropriate language file according to client browser settings.
Since 15.0 If the data sources contain only .js / .json files or Json attribute is set, there is loaded Text.js instead of Text.xml.
See the Text.xml content
new 15.0 conditional JSON

Text.js

/Grid/
Text version in JSON format. It contains the same values as Text.xml.
It is loaded instead of Text.xml if the data sources refers to .js / .json files or if Json attribute is set.
See the Text.js content
new 14.0 conditional XML

TextXX.xml

/Grid/Languages/
Language file loaded instead of Text.xml if Cfg Language is set. The XX is the Language value, e.g. DE or JP.
The TextXX.xml is referenced by default in Defaults.xml, in <Languages> section, <L> language tags, in Text_Url attribute.
Since 15.0 If the data sources contain only .js / .json files or Json attribute is set, there is loaded TextXX.js instead of TextXX.xml.
See the TextDE.xml content in German language.
new 15.0 conditional JSON

TextXX.js

/Grid/Languages/
TextXX version in JSON format. It contains the same values as given TextXX.xml.
It is loaded instead of TextXX.xml if the data sources refers to .js / .json files or if Json attribute is set.
See the TextDE.js content in German language.
new 13.0 required CSS

style_nameGrid.css

/Grid/Styles/
Responsive cascade style sheets for TreeGrid.
Compatible with IE9+ and all modern browsers. A few minor features are disabled in IE9 and IE10.
The file name prefix style_name is the style name, e.g. White.
The CSS file includes all required images. The only external files not included by default in the CSS file is the TTF font file.
The CSS file can be easily modified by changing its css sources in GridSrc/Grid/style_name/Grid.css and compiled by ../GridSrc/ShrinkCSS.exe.
How to change CSS styles is described in comments in the source Grid.css and Gantt.css.
There are actually five predefined responsive CSS styles for TreeGrid.
Every style has its own class prefix, so more Grid.css styles can be included to one page at once.
TreeGrid can have set different responsive CSS style for grid and Gantt. The Grid.css and Gantt.css use different class prefixes.
The actual grid style is set by <Cfg Style='...'/> attribute. If the Grid.css is moved, its path can be set by <Cfg CSS='...'/>, relative to the actual page URL.
Responsive CSS style can set their size by <Cfg Size='...'/>. There are nine predefined sizes: Tiny, Mini, Small, Low, Normal, Wide, High, Big, Giant.
Only one style can be used by one grid at a time, but you can switch the styles at runtime. Also every grid on page can have its own style chosen.
All files of unused CSS styles can be deleted if required.
new 13.0 required CSS

style_nameDialog.css

/Grid/Styles/
Responsive cascade style sheets for TreeGrid dialogs, menus, messages, inline edit, debug print, line chart and animations.
Compatible with IE9+ and all modern browsers. A few minor features are disabled in IE9 and IE10.
The file name prefix style_name is the style name, e.g. White.
The CSS file includes all required images. The only external files not included by default in the CSS file is the TTF font file.
The CSS file can be easily modified by changing its css sources in GridSrc/Dialog/style_name/Dialog.css and compiled by ../GridSrc/ShrinkCSS.exe.
How to change CSS styles is described in comments in the source Dialog.css.
The Dialog.css has the same CSS class prefix as Grid.css
new 13.0 conditional CSS

style_nameGantt.css

/Grid/Styles/
Responsive cascade style sheets for TreeGrid Gantt chart column content.
It is required only if used Gantt chart.
Compatible with IE9+ and all modern browsers. A few minor features are disabled in IE9 and IE10.
The file name prefix style_name is the style name, e.g. White.
The CSS file includes all required images. The only external files not included by default in the CSS file is the TTF font file, but actual Gantt CSS does not define its fonts.
The CSS file can be easily modified by changing its css sources in GridSrc/Grid/style_name/Gantt.css and compiled by ../GridSrc/ShrinkCSS.exe.
How to change CSS styles is described in comments in the source Grid.css and Gantt.css.
There are actually five predefined responsive CSS styles for TreeGrid Gantt chart.
Every style has its own class prefix, so more Gantt.css styles can be included to one page at once.
TreeGrid can have set different responsive CSS style for grid and Gantt. The Grid.css and Gantt.css use different class prefixes.
The actual Gantt style is set by <Cfg GanttStyle='...'/> attribute.
If the Gantt.css is moved, its path can be set by <Cfg GanttCSS='...'/>, relative to the actual page URL.
Responsive CSS style can set their size by <Cfg Size='...'/>. There are nine predefined sizes: Tiny, Mini, Small, Low, Normal, Wide, High, Big, Giant.
Only one style can be used by one grid at a time, but you can switch the styles at runtime. Also every grid on page can have its own style chosen.
All files of unused CSS styles can be deleted if required.
new 13.0 CSS

Grid.css

/GridSrc/Grid/style_name/
Source file for responsive cascade style sheets for TreeGrid.
They are not required to run TreeGrid.
They can be modified and the changes compiled to original CSS files by ../GridSrc/ShrinkCSS.exe compiler.
new 14.0 CSS

Dialog.css

/GridSrc/Dialog/style_name/
Source file for responsive cascade style sheets for TreeGrid dialogs, menus, messages, inline edit, debug print, line chart and animations.
They are not required to run TreeGrid.
They can be modified and the changes compiled to original CSS files by ../GridSrc/ShrinkCSS.exe compiler.
new 13.0 CSS

Gantt.css

/GridSrc/Gantt/style_name/
Source file for responsive cascade style sheets for TreeGrid Gantt chart.
They are not required to run TreeGrid.
They can be modified and the changes compiled to original CSS files by ../GridSrc/ShrinkCSS.exe compiler.
new 13.0 Win EXE

ShrinkCSS.exe

/GridSrc/
CSS compiler. Windows executable that compiles all source CSS files in /GridSrc/ directory and copies the results to /Grid/Styles/ directory. Overwrites the content in /Grid/Styles/.
All the settings for the program are in ShrinkCSS.ini placed in the same directory as the program.
CSS

Grid.css

/Grid/Compatible/style_name/
Old compatible cascade style sheets for TreeGrid.
Compatible with all browsers including old IE6+ browsers.
Every available TreeGrid style has its own subdirectory in /Grid directory and here are the Grid.css and Gantt.css files.
The Gantt.css is required only if used Gantt chart. The Grid.css is required for both grid and Gantt.
These files reference all the other image files in the style subdirectory. These image files are not accessed by TreeGrid script itself.
There are eleven available styles now: Standard, Light, Office, Gradient, Borders, Query, ExtJS, Material, Robust, Plain, Colors.
Every style has its own class prefix, so more Grid.css / Gantt.css styles can be included to one page at once.
The actual style is set by <Cfg Style='...'/> attribute.
If the Grid.css is moved, its path can be set by <Cfg CSS='...'/>, relative to the actual page URL.
Only one style can be used by one grid at a time, but you can switch the styles at runtime. Also every grid on page can have its own style chosen.
All unused styles, their subdirectories, can be deleted if required.
How to change CSS styles is described in comments in the Grid.css and Gantt.css.
CSS

Grid.css

/Grid/Compatible/style_name/
Old compatible cascade style sheets for TreeGrid Gantt chart. See Grid.css.
chg 15.0 cursor

Drag.cur

/Grid/
Since 15.0 it is used only for IE / Edge browser or in compatible style. For other browsers in responsive styles it is defined in Dialog CSS style.
Mouse cursor displayed when dragging row(s) or column(s).
The file must be placed in the same directory as GridE.js.
Can be redefined by <Cfg DragCursor/>.
chg 15.0 cursor

NoDrag.cur

/Grid/
Since 15.0 it is used only for IE / Edge browser or in compatible style. For other browsers in responsive styles it is defined in Dialog CSS style.
Mouse cursor displayed when dragging row(s) or column(s) and drop is not possible.
The file must be placed in the same directory as GridE.js.
Can be redefined by <Cfg NoDragCursor/>.
sound

Ding.wav

/Grid/
Beep played on error in EditMask when grid has set <Cfg Silent='0'/>.
The file must be placed in the same directory as GridE.js.
HTML

Help.html

/Grid/
User help for TreeGrid. It is displayed after user clicks on Help button at control panel.
Path and name you can change in input XML data, in attribute <Cfg HelpFile='...'/>.
Note, this file uses images from Standard style!
new 12.1 conditional JS

jszip.min.js

/Grid/External/
JSZip is third party library for LZ compression.
It is independent on TreeGrid. It is distributed under MIT or GPLv3 license.
It can be downloaded or its licensing read at https://stuk.github.io/jszip/.
It is loaded by TreeGrid only for client export to XLSX and import from XLSX.
To not use it at all, set <Cfg JSZip='0'/>, in this case the export will produce longer uncompressed XLSX files and the XLSX import will be disabled.
new 13.0 conditional JS

jszip.min.sync.js

/Grid/External/
Synchronous version of JSZip. It is used instead of jszip.min.js when <treegrid> Sync is set.
new 15.0 conditional JS

canvg.js

/Grid/External/
canvg.js is third party library for converting SVG to PNG images.
It is independent on TreeGrid. It is distributed under MIT license.
It is loaded by TreeGrid only in Internet Explorer when exporting SVG images to XLSX.