News in versions: FastGrid 1.0, TreeGrid 17.0
FastGrid FastSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Development
services
References References Contacts
TreeGrid Gantt chart SpreadSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Contacts
FastGrid documentation
Search in documentation
FastGrid versions compatibility

Changes log (txt file) Compare FastGrid 1.0 & TreeGrid 17.1

Using in JavaScript frameworks

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

Data and creating FastGrid

Simple examples of creating FastGrid Create FastGrid Display grid Access grid by API Sheets, more grids switched in one place Layout and configuration Data rows, columns, toolbars, images Changes in data rows, columns, toolbars Saving changes to server Mark changes Loading children on expand parent Short format

Layout - grid parts

Parts - ColParts and RowParts Part size Part scroll position Sets Column sets Row sets

Toolbars

Toolbar Cells Icon Height Width Toolbar position Dragging and manipulating cells Special toolbars

Rows and columns
Default rows, columns, cells, toolbars
Row and column identity

Row / column id Row / column index Row / column name

Row and column manipulation

API to get grid objects Auto added columns & rows on scroll Blocks of rows / columns Adding / copying / moving Deleting Showing and hiding Layout menu Selecting rows and columns Fill cell values by dragging Locking grid against changes Undo & redo

Row and column tree

Row and column tree Row tree Column tree Expand & collapse

Cells
Cell values and attributes

Read and write any values by API Cell value Cell attributes Cell value & attributes in UTF8 Store

Editing cells

Editing During editing Validation and errors

Cell images

Row cell side icons Icons definition Mark icons and charts Mark icons list Row cell floating images

Cell size

Row height Column width Resizing rows and columns Padding Margin Cell span

Cell style

Grid style and look Cell style permissions Cell style Cell outer border Cell inner border Alternate row & column background

Other cell features

Cell hyperlink Cell tooltip Static cells Other cell attributes Row & column attributes to speed up

Cell types and formats
Cell type and format Range - more values / ranges in cell String type Html type Auto type
Bool type

Bool type Check side icon Bool type & Check side icon

Number type

Format Localization

Date type

Format Localization Calendar

Calculations - formulas
JavaScript formulas

JavaScript formulas Aggregate functions String aggregate functions Other functions

Editable formulas

Formula rules Formula attributes Defined names for editable formulas 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

Dialogs and menus

Dialog Dialog Place Dialog API Menu definition in Script Cell menu List Suggest

Features
Sorting rows / columns

Sorting Sorting settings Comparing strings

Grouping rows / columns

Grouping Grouping settings Comparing strings Pivot grid

Filtering rows and columns

Filtering Filter settings Comparing strings

Search in cells Import files to grid
Export files

Export files Export and copy to clipboard CSV data

Copy & paste via system clipboard

Copy & paste Copy to clipboard Paste from clipboard

Printing

Print Print to PDF

Global grid settings
Grid size & scroll

Grid size Grid scrollbars Paging and view Media rules - responsive design

Saving settings in storage or cookies
Focus and hover cells

Focus cell and cell ranges Mouse hover cells Highlight cells, rows and columns

Events

Mouse events Key events API events

Language

Translation Languages

Messages

Message Message style

Other API

API for iterating rows and columns Paint and repaint Various API methods

Debug & files

Debugging FastGrid files

UTF8 Store - fast & short data
Introduction - License & download

Basic description Main advantages Basic usage License Download Documentation

Script language implementations

JavaScript C# JAVA PHP

Suggested ucodes

Bits - small integers or enums Integers or enums with strings Date and time Floating point numbers Special strings

Basic ucodes

Integer 1 char String 1 char Date 1 char Bits 1 char Integer 2 chars String 2 chars Date 2 chars Float 2 chars Integer 3 chars String 3 chars Date 3 chars Integer and double float 5 chars String 5 chars Date 5 chars Fixed length string Separated strings Adjacent strings Prefix for escaping string Fixed length data Unused custom codes Prefix for stored separator or length Prefix for stored base number Unused basic ucodes

Complex ucodes

chars signed decimals multiple limits varstrings escape base chars2 signed2 decimals2 multiple2 limits2

Internal coding Profiling times for ucode options Function reference

Sorting rows / columns

FastGrid documentation

Cfg bits

Sorting

[1] GetCfgAttr SetCfgAttr
If sorting is permitted, &1 - sorting rows, &2 - sorting columns.
Part string[]

Sort

GetSort SetSort
Comma separated string or array of column ids to sort rows by values in these columns. Or row ids to group columns by values in these rows.
Default direction is ascent sorting. For descent sorting pass the column/row id with prefix "-". Like Sort:"A,-B,-C,D".
Part any

DefaultSort

[...] GetSort SetSort
Row or column id to sort by it as the last one, to preset sort order even if no sort or not enough is set.
Or it can be set to 1 to set default sort to original order on data load.
Or it can be set to 2 to set default sort to original order on data load and update it also on add / move row / column.
By default it is set to 2 in Body part and null in all other parts.
Cfg bool

ShowDefaultSort

[0] GetCfgAttr SetCfgAttr
If set, show sort icon also for the DefaultSort column / row as the last one.
Row, Col bool

NoSortBy

[0] GetAttr SetAttr
If set, restricts sorting rows by values in this column or sort columns by values in this row.
Set to column / row that's cells are used for sorting.
Row, Col string

SortPart

["DefRowPart" / "DefColPart" / ""] GetAttr SetAttr
Comma separated string or array of part ids that's sorting is affected by this row or column.
The item can be set also to "DefRowPart" as DefRowPart or "DefColPart" as DefColPart.
By default it is "DefRowPart" in Header rows, "DefColPart" in Header columns and empty in all other rows and columns.
Set to header row / column that is used to change sorting.
Row, Col int

SortIcons

[10 / 11 / 0] GetAttr SetAttr
If and how the row shows icons for sorting rows or the column shows icons for sorting columns.
0 - does not show any sort icon and does not sort on click to this row / column.
1 - shows only active sort icons on the right side, 2 - next to the text, 3 - on the left side.
4 - does not show any sort icon, but sorts the rows / columns on click.
5 - shows all sort icons on the right, 6 - next to the text, 7 - on the left side.
8 - reserved
9 - shows only active sort icons on the right side and updates the column width after show / hide the icon, 10 - next to the text, 11 - on the left side.
By default it is 10 in Header rows, 11 in Header columns and 0 in all other rows and columns.
Set to header row / column that is used to change sorting.
Cfg int

SortIcons

[1] GetCfgAttr SetCfgAttr
How the sorting icons are shown / active globally:
0Simple, hidden iconsIcons are not shown, click to the whole cell changes sorting to ascending or descending.
1SimpleClick to the whole cell changes sorting to ascending or descending.
2Simple, icons onlyOnly click to the icon changes sorting to ascending or descending. Forces showing sort icons in the headers.
3DirectionalClick to the whole cell changes sorting, click to cell top (or left) half changes sorting ascending, click to cell bottom (or right) half changes sorting descending.
4Directional, icons onlyOnly click to the icon changes sorting, click to icon top (or left) half changes sorting ascending, click to icon bottom (or right) half changes sorting descending. Forces showing sort icons in the headers.
Cfg int

SortIconsNarrow

[4] GetCfgAttr SetCfgAttr
How many pixels can be sort icon overflown from both sides to not cut the cell text too much. It is subtracted from PaddingLeft/Right and IconPaddingLeft/Right.
Cell string

SortCol

GetAttr SetAttr
It can be set to cell in row with SortIcons (usually Header row cell) to sort by different column than this one. Set it to empty string to not sort by this cell at all.
Cell string

SortRow

GetAttr SetAttr
It can be set to cell in column with SortIcons (usually Header column cell) to sort by different row than this one. Set it to empty string to not sort by this cell at all.
Cfg bool

ReversedSortIcons

[0] GetCfgAttr SetCfgAttr
If set, reverses the sort icons arrows and shows arrow up (or left) for descending order and arrow down (or right) for ascending order.
Cfg int

SortType

[1] GetCfgAttr SetCfgAttr
How the sort changes when clicked cell in header row / column. The clicked cell (column / row) is set to sorting as:
0 - as the only one - permits sorting only by one column / row, should be used in combination with other types.
1 - as the first one.
2 - as the last one - cannot remove the already chosen column / rows, should be used in combination with other types.
3 - as the last one if clicked within 2 second, otherwise as the only one.
The sort type can set also in SortClick action as the fourth parameter to combine more types on different clicks.
By default on normal click uses the SortType (default 1), on ctrl+click uses sort type 3 and on shift+click uses sort type 2.
Cfg int

MaxSort

[9] GetCfgAttr SetCfgAttr
Maximal count of columns / rows to sort by.
There are defined only 9 sorting icons, so for setting MaxSort > 9 is required to define the rest icons in Icons array.
Set it to 1 to permit the only sorted column.
Cfg string[]

SortMenu

GetCfgAttr SetCfgAttr
Comma separated string or array of items shown in Sort menu. Set it to "" to not show the menu. It can contain "-" item as separator. Case sensitive. It can contain these keywords:

Locale (SortLocaleCompare, ignore diacritics, switches only between 0 / 2 values),
White (SortWhiteChars, ignore white space),
Case (SortCaseSensitive, turn on case sensitive search),
Icons (SortIcons, if and how sort icons in header behave),
Reversed (ReversedSortIcons, shows the arrows up for descending sort),
Type (SortType, how processes clicks to the next sort columns),
Max (MaxSort, maximum sorting columns 1 - 9).
Tool string

D

=

"ClearSort"

Default toolbar cell to show ClearSort icon to clear actual sorting
Click to the icon clears actual sorting and optionally sorts the parts by DefaultSort, if defined.
Click to the popup icon shows sorting options defined by SortMenu.
Actions

SortClick

(int target = 0, bool direction = 0, bool cols = 0, int sorttype = SortType) many OnClickSort... actions
Adds actual / focused column to sorting assigned to actual / focused row (for cols = 0).
Or adds actual / focused row to sorting assigned to actual / focused column (for cols = 1).
direction is 0 for ascending sort, 1 for descending. For null it changes direction if the column/row is already in sorting, otherwise uses ascending sort.
It can be run asynchrounsly when applied SyncRows.
Grid method void

SortClick

(Row / Col row, Col / Row col, bool direction = 0, int sorttype = SortType)
Adds column col to sorting assigned to row row or adds row col to sorting assigned to column row
direction is 0 for ascending sort, 1 for descending. For null it changes direction if the column/row is already in sorting, otherwise uses ascending sort.
It can be run asynchrounsly when applied SyncRows.
Grid method object

GetSort

(string part = null, int object = 0, bool nodefault = 0)
Returns actual sorting for given part. part can be comma separated string or array of part ids.
If part is not set, returns the first not null value of Sort value in any part.
For object = 0 returns comma separated string.
For object = 1 returns array as [col1,desc1,col2,desc2,...].
For object = 2 returns object as {col1:1/-1,col2:2/-2,col3:3/-3,...}.
For object = 3 returns object like 2 and for no sort returns empty object instead of null.
For nodefault = 1 does add DefaultSort.
Grid method void

SetSort

(string sort = null, string part = null)
Sets or clears the sorting for given part. part can be comma separated string or array of part ids.
If part is not set, sets Sort value of parts that's are referred by some SortPart and are applicable for given sort.
sort can be comma separated string or array of column / row ids to sort by.
If sort is empty string or null, clears the sorting for given part.
Resorts the part(s) even if sort is the same as actual sort.
It can be run asynchrounsly when applied SyncRows.
Grid method void

ReSort

(string part = null)
Sorts given part again without changing the settings. part can be comma separated string or array of part ids.
If part is not set, re-sorts all parts with Sort or DefaultSort set.
Actions

ClearSort

(int target = 0, string part = null) OnClickClearSort
Clears Sort in the parts part (comma separated string or array of part ids) and resorts them by DefaultSort if set.
For part = null / 3 clears all parts, for 1 clears all row parts, for 2 clears all column parts.
API event bool

OnSort

(Grid grid, string part, string sort)
Called before the grid part is sorted.
part is the part id id, sort is comma separated string with new sorting, it can be empty string for sort by DefaultSort.
Return true to not sort the part.
If called the OnGroup, the OnSort is not called when sorting after the grouping is done.
API event void

OnSorted

(Grid grid, string part, string group, string oldgroup, Row first, Row last)
Called after the grid part is grouped and sorted.
part is the part id id, sort is comma separated string with new sorting, it can be empty string for sort by DefaultSort.
If called the OnGrouped, the OnSorted is not called when sorting after the grouping is done.

Sorting settings

Row, Col bool

NoSort

[0] GetAttr SetAttr
If the row or column children are removed from sorting - the immediate children are not sorted, but their children can be sorted.
Set to row / column being sorted.
Row, Col int

SortFix

[0] GetAttr SetAttr
Fixes the row or column on the part edge, regardless on sorting.
Positive value fixes the row on part top or the column on part left, the higher value the closer the edge.
Negative value fixed the row on part bottom or the column on part right, the smaller value the closer the edge.
Set to row / column being sorted.
Cell any

SortValue

GetAttr SetAttr
Value used instead of cell value for grouping and sorting.
Set to row / column cell being sorted.
Row, Col int

NumberSort

GetAttr SetAttr
How to sort numbers:
0 - string sort: 1, 15, 16xx, 2, 200, 23xx, 3, 30,...
1 - number sort: 1, 2, 3, 15, 30, 200, 16xx, 23xx..., the strings that cannot be converted to number are sorted at the end.
2 - date sort: converts dates set as date strings to number of milliseconds and sorts these numbers.
3 - number range sort: if value is range of numbers, sorts according to the first number in the range like in 1.
4 - date range sort: if value is range of dates, sorts according to the first date in the range like in 2.
null - uses 0 string sort for column / row Type = "String", "Html" and "Auto", 1 number sort for Type = "Bool", "Number" and 2 date sort for Type = "Date".
Set to column / row that's cells are used for sorting.
! Row, Col bool

SortList

GetAttr SetAttr
If set to 1, uses for sorting the values from List, if defined. Slows down the sorting.
If set to 2, uses for sorting and grouping the values from List, if defined. Slows down the sorting and grouping.
If not set, ignores the list and uses always the raw cell value for sorting and grouping.
Cfg int

SortMethod

[0] GetCfgAttr SetCfgAttr
Specifies sorting algorithm. Try to change it if native sort is too slow for some large data.
0 - Native sort, 1 - Merge sort recursive, 2 - Quick insertion sort non recursive, 3 - Quick sort recursive, 4 - Heap sort recursive.

Comparing strings

Cfg bool

SortCaseSensitive

[0] GetCfgAttr SetCfgAttr
If the strings in sorting are compared as case sensitive. Used only if the row, column has not set the CaseSensitive attribute.
Row, Col, Cell bool

CaseSensitive

[0] GetAttr SetAttr
If the strings are compared as case sensitive.
The case sensitive sorting differs according to the LocaleCompare, if set, sorts aAbBcC, if not set, sorts as Unicode ABCabc.
For sorting and grouping it can be set only to row or column, for filtering it can be set also to filter cell and for generated List by *Rows / *Cols also to the cell with the List.
Cfg any

SortLocaleCompare

[0] GetCfgAttr SetCfgAttr
If set, compares strings in sorting according to locale meaning. Used only if the row, column has not set the LocaleCompare attribute.
0a<b<áaccording to unicode
1a<á<baccording to default locale
2a==á<baccording to default locale
"locale"a<á<baccording to specified locale (e.g. "en-US" or "cs-CZ")
"=locale"a==á<baccording to specified locale (e.g. "=en-US" or "=cs-CZ")
Row, Col, Cell any

LocaleCompare

[0] GetAttr SetAttr
If set, compares strings according to locale meaning.
0a<b<áaccording to unicode
1a<á<baccording to default locale
2a==á<baccording to default locale
"locale"a<á<baccording to specified locale (e.g. "en-US" or "cs-CZ")
"=locale"a==á<baccording to specified locale (e.g. "=en-US" or "=cs-CZ")
For sorting and grouping it can be set only to row or column, for filtering it can be set also to filter cell and for generated List by *Rows / *Cols also to the cell with the List.
Cfg string

SortWhiteChars

["- "] GetCfgAttr SetCfgAttr
List of characters to ignore when comparing strings for sorting. Used only if the row, column has not set the WhiteChars attribute.
It can be set for example to " " (space) to ignore spaces (it means that for example "a b c" and "abc" strings are the same.
If starts by "-", it is ignored, but can be turned on in SortMenu.
Row, Col, Cell string

WhiteChars

GetAttr SetAttr
List of characters to ignore when comparing strings.
It can be set for example to " " (space) to ignore spaces (it means that for example "a b c" and "abc" strings are the same.
For sorting and grouping it can be set only to row or column, for filtering it can be set also to filter cell and for generated List by *Rows / *Cols also to the cell with the List.
Row, Col, Cell string[*]

CharCodes

GetAttr SetAttr
It changes characters in comparing strings.
It is first character separated array of pair of characters to replace the first character by the second one when comparing strings.
For example "|y|i|Y|I|.|," - replaces 'y' by 'i', 'Y' by 'I' and '.' by ',' - it means that when comparing strings does not differ between letter 'y' and 'i', both cases and also does not differ between comma and point.
The first character must be one letter, but the second in fact can be any letter or string or even empty string, like "|a|xxx|b||c|ff".
For sorting and grouping it can be set only to row or column, for filtering it can be set also to filter cell and for generated List by *Rows / *Cols also to the cell with the List.
Row, Col, Cell bool

RemoveHtml

GetAttr SetAttr
If set, removes all HTML code when comparing strings during sorting, grouping and filtering.
For sorting and grouping it can be set only to row or column, for filtering it can be set also to filter cell and for generated List by *Rows / *Cols also to the cell with the List.