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

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 upd 15.0 <C> <I> <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")
Special format
Since 14.0 if the format string contains asterisk (*), it loads the user defined formats from <Lang><Format ... /></Lang> tag.
For example: <Lang><Format num='0' dec='.00##' exp='E+00'/><Lang>, Format="*num" is converted to "0", Format="num*dec" is converted to "0.00##", Format="num*dec* *exp" is converted to "0.00## E+00".
The special format can refer another special format, these references should contain asterisk on both sides.
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.
?(new 13.0) Place for a digit, displays digit or empty space if there are no more digits. Has sense only for decimal part.
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) Separates formats used according to the value size and type.
There can be up to four default formats without condition and next more conditional formats. The conditional formats should be placed before default formats.
1st default format is used for positive numbers (and for 0 if the third format missing).
2nd default format is used for negative numbers (without minus sign).
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.
3rd default format is used for 0.
4th default format since 13.0 is used for text (in Auto type only). It can contain character @ to place actual text value here. If it does not contain the @, the actual value is not displayed.
If the 4th format is missing, the Auto type displays the text value as is.
If the 2nd or 3rd format contains the character @ it is automatically used for the text value and not for negative or zero values.
[color] (new 13.0) Colors the whole part (parts are separated by semicolon) in given CSS color.
[condition] (new 13.0) Uses given part (parts are separated by semicolon) only if the value fulfills the condition.
Condition can be: [=value], [<>value], [<value], [<=value], [>value], [>=value].
_ (new 13.0) (Underscore) Places space as wide as the next character after the "_". The next character is not printed.
$ (new 14.0) Places actual Currency string, default is $.
/ (new 15.0) (Slash) Fractional number. It is followed by number of ?, their number specifies maximal fraction-1, e.g. "/???" means 1/999.
If followed by digits instead of ?, the whole number specifies exact fraction to display, e.g. "/16" will display 1/16 - 15/16.
\ (Backslash) 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.
Since 15.0 it is read also from row.
upd 15.0 <C> <I> <cell> string

EditFormat

Format string to display the number for editing. It does not affect the input format of the numbers.
Since 15.0 it is read also from row.
new 16.2 <Cfg> string

EditNumberFormat

Specifies format for editing for all cells without EditFormat of "Int", "Float" or "Auto" type containing number.
Usual setting for spreadsheet is EditNumberFormat="0.########".
chg 15.0 <C> <I> <cell> string

ExportFormat

TreeGrid number format to be used instead of the cell Format for export to Excel.
Its format is the same as Format, it is converted to Excel number format.
From 12.1 to 14.1 it was not used for old xls export except for ExportType="Dates", it used XlsFormat instead.
Since 15.0 it is used for all exports, including xls and it is also read from row.
new 12.1 chg 15.0 <C> <I> <cell> string

XlsFormat

Excel number format to be used instead of the cell Format and ExportFormat for export to Excel.
It is exact MS Excel format string passed directly to xlsx format or to xls CSS attribute mso-number-format.
Since 15.0 it is used also for xlsx and it is also read from row.
It is not used to export to csv.
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.
new 15.0 <Cfg> bool

HideZero

[0] Saved to cookies, to not save it set HideZeroLap='1'
If set, all zero values in Int, Float and Auto types are displayed empty.
new 13.0 upd 16.3 <Cfg> int

RoundNumbers

[0]
If all numbers (Float and Int types) in grid will be rounded to RoundNumbersDigits, bit array.
1. bit &1 - Rounds all numbers in cells without Format.
2. bit &2 - Rounds all numbers in cells with Format. Before the number is formatted.
3. bit &4 - If set, rounds to RoundNumbersDigits all digits, otherwise rounds only decimal digits.
4. bit &8 - (new 16.3) Rounds all numbers in cells with Format = '@'.
new 13.0 <Cfg> int

RoundNumbersDigits

[5]
Number of decimal digits to round numbers by RoundNumbers. Can be also negative.
new 13.3 upd 15.1 <Format> int

StrictNumbers

[0]
1. bit, if set to 1, restricts entering incorrect numbers. If not set, accepts also partial numbers like "3.2.4" and converts them to correct numbers like "3.2".
2. bit, if set to 2, restricts entering hexadecimal values in Int and Auto types. (new 15.1)
new 14.0 <Format> bool

EditPercent

[0]
Since 14.0.11 If set and Format contains "%", the entered number will be always percentage value, even if a user deletes the "%" during editing.
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.
new 14.0 <Format> string

Currency

[$]
The string displayed instead of dollar 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>