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) Upgrading from 9.3 to 10.0 Upgrading from 5.9 to 6.0

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 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 and type Cell value Reading / writing attributes by API Cell HTML 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 Defaults list Suggest list (auto complete) 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) Mathematical functions 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 Special cell style attributes Cell CSS class Cell background color Dynamic cell border Cell HTML style Row color alteration Cell mouse cursor

Cell types
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 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 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 Basic settings Communication with server Export API Client export Server export

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 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

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 Language & regional setup (Text.xml) Useful API function Help file

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 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

Number - Int & Float

TreeGrid documentation

Int type shows integer number in selected format.
Float type show floating point number in selected format.
The only difference between the types is that the Int type does not accept the decimal separator and exponent characters while editing.
In the input / output XML is the Float type always in English notation with dot as floating point separator.

Format

<C> <cell> string

Type

["Text"] Type = "Int" or "Float"
To define Int type, set column or cell attribute Type to "Int", for Float type set Type to "Float".
new 6.0 chg 12.0 <C> <cell> bool

CanEmpty

[0/1]
If the cell number value differ between 0 and "". Remember the default value is 0, except in Filter row.
If set to 0, the empty input value is always converted to 0. So the cell never contains (empty) string value.
It is good to set it to 0 when the numbers are sources for a Formula.
Since 12.0 the default value for Filter row is 1.
new 6.0 <C> <cell> string

EmptyValue

[""]
The string displayed when the date value is entered as empty string.
The cell can contain empty value only if CanEmpty is 1.
It is shown only for display, not for edit.
It is not escaped, it can contain HTML code.
chg 7.0 <C> <cell> string

Format

Specifies number string format - how the number will be displayed.
This format string uses almost the same formatting as Microsoft .NET System.DateTime.ToString (string format) function.
Empty format
If the Format is not set or is empty (default), the default English format is used with a dot as floating point separator.
Standard format
Standard format is one letter format. This format loads user format from file Text.xml, tag <Format>, attributes "n.."

"g"General(ng = "0.######" , ngg = "0.###### E+00"), for numbers under 1e10 uses ng, above uses ngg.
"f"Fixed(nf = "0.00")
"c"Currency(nc = "$###########0.00")
"p"Percent(np = "0.00%")
"r"Rounded(nr = "0.0000", nrg = "0.0000 E+00"), for numbers under 1e10 uses nr, above uses nrg.
"e"Scientific(ne = "0.000000 E+000")
User format
User format can contain any characters but only few have special meaning and the others are written into output without any change.
Since 6.2 version if there no '0' and '#' in format string, no number is shown, only the format string.
There can be maximally 20 digits (0 and #) shown before and after decimal point. Note, JavaScript has maximally 17 digits precision.
0Place for a digit, displays digit or 0. If there are more digits than count of 0 and # in integer part, all the rest digits are written left to the first 0 or #.
#Place for a digit, displays digit or nothing if there are no more digits. Has sense only for decimal part or exponent definition.
8 (new 7.0) Hidden digit, the digit will not be displayed. Digits are always counted from decimal separator position to both sides.
It cannot be combined with '#' in the same number part. It can be used only for left and right side of integer part or left side of decimal part.
Example: Val = "123456.789", Format = "8000" => Result = "456"; Format = "088" => Result = "1234"; Format = "8.80" => Result = "8"
. (Dot) Decimal separator. Displays decimal separator defined in file Text.xml, tag <Format>, attribute DecimalSeparator. (dot by default).
Can be only used only once.
, (Comma) This character has two meanings:
If this is placed between any digits characters ('0' or '#') left to decimal separator, there will all three digits separated by thousand separator defined in file Text.xml, tag <Format>, attribute GroupSeparator. (comma by default).
Example: Val = "123456.789", Format = ",0.00" => Result = "123,456.79"
(since 10.0) It is possible to specify different number of separated digits than 3 by <Format> attributes GroupCount1 (the last group) and GroupCount (other groups).
For example for Indian number format set <Format GroupCount1='3' GroupCount='2'/>
If this is placed between last digit and decimal separator (or to the end if decimal separator is not used), the value will be divided by 1000. There can be more commas to divide more times.
Example: Val = "123456.789", Format = "0,,.00" => Result = "0.12"
% Place for '%' character (it is defined in file Text.xml, tag <Format>, attribute Percent). If it is present, the number is also multiplied by 100.
To place the % character without multiplying by 100, write it with backslash "\%".
E, e, E-, E+, e-, e+    Result will use exponential notation. To this location is placed 'E' or 'e' letter followed by digits of exponent.
  If used exponential notation, the number of digits before decimal separator is given by count of all digit places ('0' or '#') before decimal separator.
This letter must be followed by number digit places ('0' or '#') to specify number of exponent digits.
E or e specifies case of E letter, E+ uses sign + for positive exponents, E- and E uses no sign for positive exponents.
Example: Val = "123456.789", Format = "000.000 E+00" => Result = "123.456 E+03"
Example: Val = "-0.0123456789", Format = ":0.0000(E000)" => Result = ":-1.2346(E-002)"
; (Semicolon) There can be up to three different formats separated by semicolon.
The first format is used for positive numbers (and for 0 if the third format missing), second for negative numbers (without minus sign) and third for 0.
Remember, from the negative part is read only string before number and after the number, all other (the number format) is used always from positive part.
So the negative part can be used only to remove, replace or change position of the minus or change CSS attribute like color by the prefix and postfix.
\ Escape character, the next character is placed to output without any changes. Use to place format characters as 0 # . , E e + - \ " ' %.
'xxx' or "xxx"    Characters in quotes or double quotes are placed to output without any changes. Use to place format characters as 0 # . , E e + - \ " ' %.

For example: Format='$0.00' => "$0.10" or "$12.54"
Format=' #.00##;<span style=\'color:red\;\'>#.00##</span>;nothing' => negative numbers in red, 0 as nothing

If you want add HTML tags before and after value, use rather cell attributes HtmlPrefix and HtmlPostfix instead of Format.
If you really need to place HTML tags into output (for example to use different HTML tags for positive and negative numbers), set <Cfg NoFormatEscape='1'>. The HTML tags can be set in Format only, not in EditFormat.
upd 6.0 <C> <cell> string

EditFormat

Format string to display the number for editing. It does not affect the input format of the numbers.
<C> <cell> string

ExportFormat

A number format to export to Excel. Used only for Export_Type = 0.
It is specific Excel number to export the number in specific format.
If you don't know the format for the cell, create xls file with one cell, specify its format you want and save it as one file web page (mht file).
Open this mht file and search style property "mso-number-format" and its value set to the ExportFormat.
The standard values are "Fixed" for 0.00 or "Scientific".
The format string is similar to TreeGrid number format, but with escaped all not number and not digit characters by backslash.
Here are some sample formats: "0\.00" displays two required decimal digits, "0\.#\#" displays maximally two decimal digits, "\#\,\#\#0\.0000" separates every 3 digits by ',' and shows decimal 4 digits.
chg 6.0 <C> <cell> bool

NoFormatEscape

[1]
If set to "", it means 0 for text and 1 for number and date.
If set to 0, the Format is escaped, so the characters & and < are displayed as they are.
If set to 1, you can use HTML tags in columns Format string, in prefix and postfix for text and anywhere for numbers.
global func. string

NumberToString

(Number num, string format)
Converts number to string according to format string as in function ToString() in C#.NET.
global func. Number

StringToNumber

(string str, string format)
Converts string to number

Localization

The default number format and setting are specified in Text.xml, in <Lang><Format /></Lang> tag.
The default settings is for English language, changing the Format tag attributes you can easily localize it to another language.
new 12.0 <Format> bool

BaseSeparators

[0]
Controls Int, Float and Date types conversions to string without explicit format string set.
If set to 1, it always uses standard U.S. English decimal, date and time separators and also date order M/d/yyyy.
If set to 0, it uses actual DecimalSeparator, DateSeparator and TimeSeparator and date format is chosed according to the date separator as "M/d/yyyy" or "d.M.yyyy" or "yyyy-M-d".
Prior to 12.0 the default value and behavior was 1, since 12.0 was changed to 0!
<Format> string

DecimalSeparator

[.]
The string displayed as floating point separator.
You can set it also dynamically by API according to browser's locale by such code:
Grids.OnLoaded = function(G){ G.Lang.Format.DecimalSeparator = Number(1.5).toLocaleString().charAt(1); }
new 6.0 <Format> char[ ]

InputDecimalSeparators

[.,]
The characters permitted to input as decimal separator.
<Format> string

GroupSeparator

[,]
The string displayed as thousands separator.
new 6.0 <Format> char[ ]

InputGroupSeparators

[ ]
The characters permitted to input as group separator.
Now it should be empty because it is not permitted to input numbers with group separator.
<Format> string

Percent

[%]
The string displayed as percentage character.
<Format> string

NaN

[NaN]
String displayed for incorrect number - Not A Number.
new 12.0 <Format> int

Digits

[]
First character separated array of 10 digits strings to replace the standard digits 0 - 10.
Useful to display Arabic digits instead of standard digits by such definition:
<Lang><Format Digits="|&#x660;|&#x661;|&#x662;|&#x663;|&#x664;|&#x665;|&#x666;|&#x667;|&#x668;|&#x669;"/></Lang>
It replaces all digits in all cells, regardless of the cell type!
new 12.0 <C> <cell> int

Digits

[]
Digits to replace for this cell or column. Used only if some <Format Digits> are defined.
Set it to empty string to not use the <Format Digits>