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

List & Combo - Enum & Radio

TreeGrid documentation

Introduction

The Enum and Radio types specify a list of values and let user to choose on or more from them.
These cells are not editable by <input>, so a user cannot enter another value that the ones in list.
To have a combo with input use Defaults list with Text type.
Enum type
A user selects the item(s) from combo box (similar to <SELECT> tag).
It is possible to let a user to select more items by setting Range attribute.
If you want to mix selection from list and direct value editing, use rather Defaults list instead of Enum type.
The left Enum icon can be hidden by setting attribute Icon="". To place it to the right set IconAlign='Right'
Radio type
All items are displayed with radio button or checkbox and a user checks one or more of them.
It is possible to let a user to select more items by setting Range attribute.
Select type
Cell type Select is special type to show not editable combo with list of predefined values.
Its functionality is similar to Enum type, but it does not have its complexity. It just permits selecting cell value from popup list.
It is just shortcut for Type="Html" Button="Defaults".
The predefined list is defined by Defaults attribute.
Since 9.2 it is possible to simulate Enum value/key pairs by Html type Format attribute.
It does not have any Enum attribute listed below, here is stated just for its similarity to Enum.
Changing a look between Select type and Enum type
If you want to have Enum type looking like the Select type, set:
Type="Enum" Button="Defaults" Icon="" ShowEnumHeader="0"

If you want to have Select type looking like the Enum type, set:
Type="Html" Icon="Enum" Cursor="Pointer" OnClick="ShowDefaults" Wrap="0" Class="TxSelect" (where Tx is Style prefix, e.g. TSSelect for Standard style)
Value in Enum and Radio cell
The Enum cell value can be set as
a) index to Enum array, from 0. For example Enum='|One|Two|Three', Value='2' as Three
b) value from Enum array. For example Enum=' |One|Two|Three', Value='Three'
c) value from EnumKeys array. For example Enum=' |One|Two|Three' EnumKeys='|A|B|C' Value='C' as Three
To distinguish ambiguity cases between a) and b) when Enum array contains numbers, set IndexEnum (by default is preferred b)).
After change of the value, the value is set by the same way as it was preset (index/Enum name/EnumKeys name).
To distinguish ambiguity cases between a) and b) when changing empty / null Enums, set IndexEnum (by default is preferred b)).
The Enum value is uploaded to server as it is set in data.
When set Range, the value contains list of selected items, separated by semicolon. The items can be also index/Enum name/EnumKeys name.
Filter
If the Enum or Radio type cell is used in Filter row, it automatically hides the filter operator menu.
For Enum it adds one empty item as the first item to the list to clear the filter.
For Radio it adds one item "off" as the last item.
You can change this behavior by FilterOff attribute.
To filter by more Enum values set Range attribute of the Filter cell.

Definition

<C> <cell> string

Type

["Text"] Type = "Enum" or "Radio"
To define Enum type, set column or cell attribute Type to "Enum", for Radio type set Type to "Radio".
<C> <cell> string[*]

Enum

A list of values to select from. It is first character separated array (the first character in the string is separator). For example ",one,two,three" or "|1,1|2,3".
This value will be shown in the cell.
This list will be also shown in expanded combo if EditEnum and EnumMenu are not set.
chg 6.0 API event string

OnGetEnum

(TGrid grid, TRow row, string col, string enum)
Called to get Enum attribute dynamically. Returns enum or new enum list.
<C> <cell> string[*]

EnumKeys

A list of keys for Enum type.
If set, the Enum type cell contain this key instead of Enum name or index.
The EnumKeys must have the same order and count as Enum array.
API event string

OnGetEnumKeys

(TGrid grid, TRow row, string col, string enum)
Called to get EnumKeys attribute dynamically. Returns enumkeys or new enum keys list.
upd 6.0 <Filter cell> string

FilterOff

[' ']
You can set FilterOff to existing value or index to use this item to clear filter.
Or you can set it to not existing value to show the FilterOff value as the "clear filter" item caption.
If the Enum/Radio uses number indexes, the index is automatically shifted to let the list to be the same as in the other cells!
new 7.0 <Filter cell> bool

FilterEnumKeys

[0]
If set to 0 it filters by Enum string.
If set to 1 it filters by Enum value, by key or index.
<Cfg> bool

IndexEnum

[0]
If the number cell values will be taken as index to Enum (from 0) or as value from Enum. 0 - value, 1 - index.
Only for ambiguity cases - when Enum contains a number or when changed from empty or null value.
In all other cases it is chosen according to the actual value.
It is ignored when set EnumKeys.
new 6.0 upd 7.0 <C> <cell> bool

CanEmpty

[0]
If the enum index can be empty, only for enums set by index.
If set to 1, the cell value differs between 0 and "". It is by default set to filter.
Since 7.0 it also controls behavior of the Clear attribute, for 0 Clear sets the first value from Enum, for 1 it sets empty string.
new 6.0 <C> <cell> string

EmptyValue

[""]
The string displayed when the enum text is empty. Useful especially for Range cells.
It is shown only for display, not in popup menu.
It is not escaped, it can contain HTML code.
<C> <cell> bool

Range

[0]
If the cell accepts more values. Usable especially in filter cell.
Enum type can select more values from combo box. Defaults dialog supports selecting more values for any cell type.
Radio type can have checked more values at a time.
The chosen values in cell are separated by semicolon. The characters ';' can be changed by <Lang><Format ValueSeparator=';'</Lang>

Related lists

The Enum and Radio type lists can be related, one cell will have different lists for different values in another cell. Like Continent -> Country -> State -> Region -> City.
upd 6.0 <C> <cell> string[ ]

Related

The comma separated list of columns this Enum list is related to. The Enum list relies on values in these columns.
It defines dependent lists like Country -> State/County -> City.
The enumeration lists (Enum, EnumKeys, EditEnum and EnumMenu attributes) for the cell are chosen according to value(s) in Related columns from EnumA_B_C... attributes, where A,B,C are column values from cells in columns in Related list, in that order.
Use with Refresh or Clear attribute. When the attribute for the values does not exist, the original attribute without prefix is used.
The postfixes are the exact values in the cells, if you use EnumKeys use the values from EnumKeys, if you use names from Enum, use these names and if you indexes to Enum, use the indexes.
Example (B is related to A, C is related to B and also to A)
<C Name='A' Type='Enum' Clear='B,C' Enum='|One|Two'/>
<C Name='B' Type='Enum' Related='A' Clear='C' Enum0='|a|b|c' Enum1='|1|2'/>
<C Name='C' Type='Enum' Related='A,B' Enum0_0='...' Enum0_1='...' Enum0_2='...' Enum1_0='...' Enum1_1='...'/>
new 6.0 upd 7.0 <C> <cell> string[ ]

Clear

Which cells to clear after value of the cell changes. Usually used with Related attribute.
The comma separated list of column names. The cells in the same row and in these columns will be cleared - their value set to "".
Since 7.0 it is affected by CanEmpty attribute, for 0 Clear sets the first value from Enum, for 1 it sets empty string.
upd 6.0 <C> <cell> string[ ]

Refresh

Which cells to refresh after value of the cell changes. Usually used with Related attribute.
The comma separated list of column names. The cells in the same row and in these columns will be refreshed.
Has sense only for index enums, for string enums use rather Clear.

Enum specific

<C> <cell> string[*]

EditEnum

A list of values for Enum type to display them in expanded combo when editing.
If it is missing it is used Enum array instead.
Useful to show different item names in cell and in expanded combo list.
new 6.0 API event string

OnGetEditEnum

(TGrid grid, TRow row, string col, string editenum)
Called to get EditEnum attribute dynamically. Returns editenum or new edit enum list.
new 6.0 <C> <cell> string

EnumMenu

Full JSON definition of the list displayed on expanding combo to select Enum value(s).
It supports extended capabilities like submenus and collapsible sections.
It is more extended alternative to EditEnum.
The menu format is standard TreeGrid menu.
new 6.0 chg 16.2 API event string

OnGetEnumMenu

(TGrid grid, TRow row, string col, string enummenu)
Called to get EnumMenu attribute dynamically. Return enummenu or new enum menu list.
Since 16.2 return empty string to not display the enum menu.
<C> <cell> string

IntFormat

A format when the Enum value is set to number that is out of range or does not exist in Enum / EnumKeys.
Useful for number types to show a name for first few values and the rest as normal formatted integer.
Example: Enum='|never|once|twice' IntFormat='###0 times'
It should be used for read only cells. Works also for floating point numbers.
new 9.2 <C> <cell> bool

ShowEnumHeader

[1]
For 0 it does not show header for Enum popup list.
Use to display Enum type like Select type (or Button=Defaults). Set for the cell: Button="Defaults" Icon="" ShowEnumHeader="0"

Radio specific

new 6.0 <C> <cell> int

Wrap

[0]
How the items will be wrapped inside the cell.
0 to show all items at one line, 1 to split items to more lines if needed, 2 to show every item at one line
new 14.0 <C> <cell> int

RadioWrap

[1]
If the individual radio cells content will be wrapped.
new 6.0 upd 11.0 <C> <cell> type

RadioIcon

[0]
Icon displayed for buttons
Since 11.0 it can be also first character separated array of strings as icon files for 0 and 1 value, e.g. RadioIcon="|Off.gif|On.gif"
There can be also two more icons for CanEdit='0' state, e.g. RadioIcon="|Off.gif|On.gif|OffRO.gif|OnRO.gif "
Or it can contain icons for all items in the radio, e.g. RadioIcon="|Off1.gif|On1.gif|Off2.gif|On2.gif|Off3.gif|On3.gif|Off4.gif|On4.gif"
There can be also one more set icons for CanEdit='0', .e.g. RadioIcon="|Off1.gif|On1.gif|Off2.gif|On2.gif|Off3.gif|On3.gif|OffRO1.gif|On1RO.gif|Off2RO.gif|On2RO.gif|Off3RO.gif|On3RO.gif "
0 - displays radio button images for normal cell or checkbox images for Range cell.
1 - displays radio button images
2 - displays checkbox images
3 - displays <input type='radio'> for normal cell or <input type='checkbox'> for Range cell. It is slower than displaying images.
4 - displays <input type='radio'>. It is slower than displaying images.
5 - displays <input type='checkbox'>. It is slower than displaying images.
6 - (new 11.0) hides the icon, shows only the radio text
new 6.0 <C> <cell> bool

RadioRight

[0]
If set to 1, displays the icon on the right instead of left.
new 6.0 <C> <cell> bool

RadioUncheck

[0]
If the checked radio button can be unchecked to have all buttons empty - only for normal non Range cell.
new 11.0 <C> <cell> int

RadioIconWidth

[18]
Width in pixels of custom icons in RadioIcon (if RadioIcon is set to array of strings).
<Actions>

ChangeRadioRight ...FAO

Attached to event OnCtrlRight
Selects item in radio, the right one next to the actually selected, cannot be used for Range cells.
new 7.0 <Actions>

ChangeRadioRightCycle ...FAO

Attached to event OnEnter
Selects item in radio, the right one next to the actually selected, cannot be used for Range cells.
For the last item checked checks the first item.
<Actions>

ChangeRadioLeft ...FAO

Attached to events OnCtrlLeft
Selects item in radio, the left one next to the actually selected, cannot be used for Range cells.
new 7.0 <Actions>

ChangeRadioLeftCycle ...FAO

Not attached to any event
Selects item in radio, the left one next to the actually selected, cannot be used for Range cells.
For the first item checked checks the last item.
new 6.0 <Actions>

ChangeRadio

Attached to event OnClickEditRadio
Selects item in radio, the one under mouse cursor