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

Number type

FastGrid documentation

Integer or floating point numbers, the same as JavaScript "number" type.
In the input / output JSON is the floating point number always in English notation with dot as floating point separator.
Displayed and edited can be also with different decimal and group separators.

Format

Cell, Tool string

Type

["Auto"] Type = "Number" GetAttr SetAttr
Number type can be explicitly set by Type = "Number" or it can be automatically chosen if the cell value is number in default Type = "Auto"
Cell, Tool any

V / Value

GetValue / GetAttr SetAttr
The number values in input JSON and by API GetValue / SetValue can be set only as JSON / JavaScript number, with dot as floating point separator and without any group separator.
It should not be set as string!
Cell, Tool string

Format

GetAttr SetAttr
Specifies number string format - how the number will be displayed.
It is not used for editing, except '%' mark for editing percentage number.
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 JavaScript format is used, DecimalSeparator as decimal separator and without group separator.
The very big and very small numbers are displayed in exponential notation.
The strings that cannot be converted to number are displayed as they are in Auto type and as NaN in Number type.
The NaN and Infinite numbers are displayed as NaN.
Standard format
Standard format is 1 - 3 letter format. This format loads user format from file Texts.js, object Format, attributes "n.."
"g"GeneralFor numbers under 1e-3 uses "0.###e+00", for numbers above 1e10 uses "0.########e+10", for other numbers uses "0.######", .
"f"FixedUses "0.00"
"fs"Fixed with group separatorUses ",0.00"
"c"Currency language dependentFor positive numbers uses "$,0.00", for negative numbers "($,0.00)" or "-$,0.00"
"cm"Currency with negative signFor positive numbers uses "$,0.00", for negative numbers "-$,0.00"
"cmr"Currency with colored negative signFor positive numbers uses "$,0.00", for negative numbers "[brown]-$,0.00"
"cp"Currency with negative in ()For positive numbers uses "$,0.00", for negative numbers "($,0.00)"
"cpr"Currency with colored negative in ()For positive numbers uses "$,0.00", for negative numbers "[brown]($,0.00)"
"p"Percent multiplied by 100Uses "0.00%"
"pp"Percent without multiplication Uses "0.##\\%"
"r"RoundedFor numbers under 1e10 uses "0.0000", above uses "0.########e+10".
"e"ScientificUses "0.000000 E+000"
Assembled format
If the format string contains asterisk (*), it loads the user defined formats from the Format object.
For example: Format: { num:'0', dec:'.00##', exp:'E+00' }< 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 assembled format can refer another assembled 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.
If there no '0', '#', '?', '8' 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.
?Place for a digit, displays digit or empty space if there are no more digits. Has sense only for decimal part.
8 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 Texts.js, object Format, attribute DecimalSeparator. (dot by default).
Can be only used only once.
, (comma) This character has two meanings:
1) If it is placed between any digits characters ('0' or '#') left to decimal separator, there will be every three digits separated by thousand separator defined in file Texts.js, object Format, attribute GroupSeparator. (comma by default).
Example: Val = "123456.789", Format = ",0.00" => Result = "123,456.79"
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 }

2) If it 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 Texts.js, object Format, attribute Percent). If it is present, the number is also multiplied by 100.
To place the exact '%' 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 (max 3).
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 five formats without condition and next more conditional formats. The conditional formats should be placed before formats without condition.
1st format is used for positive numbers (and for 0 if the 3rd format missing).
2nd format is used for negative numbers (without minus sign).
3rd format is used for 0 and for all numbers rounded to 0 with given precision.
4th format is used for text. It can contain character @ to place actual text value here. If it does not contain the @, the actual value is not displayed.
5th format is used for NaN. If it is missing, the default NaN and NaNFormat are used.
If the 4th format is missing, the Auto type displays the text value as is and Number type shows NaN.
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] Colors the whole part (parts are separated by semicolon) in given CSS color.
[condition] Uses given part (parts are separated by semicolon) only if the value fulfills the condition.
Condition can be: [=value], [<>value], [<value], [<=value], [>value], [>=value].
$ Places actual Currency string, default is $.
/ (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 + - \ " ' %.
In JSON all the characters '\' must be doubled. To place the '\' itself, doubled it '\\' (in JSON as '\\\\').
'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##;[red]#.00##;nothing' => negative numbers in red, 0 as nothing

Cell, Tool string

EditFormat

GetAttr SetAttr
Format string to display the number for editing. If not set, it shows the unformatted number.
It never uses the Format for editing, except '%' mark for editing percentage number.
!! Cfg bool

HtmlFormat

[0] GetCfgAttr SetCfgAttr
If set, the Format can contain HTML code. Remember, the code must be in '' or "" and must contain only inline tags, like Html type.
Using many cells with HTML code remarkably slows down paint!
Cfg int

HideZero

[0] GetCfgAttr SetCfgAttr
If set, all zero values in Number and Auto types are displayed empty or as EmptyValue value.
If set to 2, it hides the zero values also in toolbar cells.
Cfg bits

AlignError

[34] GetCfgAttr SetCfgAttr
How the NaN numbers and dates shown as errors (NaN or NaD) will be horizontally aligned. 0 - left aligned, 1 - right aligned, 2 centered.
If set with 6. bit (&32), it overrides the cell Align, otherwise it is ignored if the cell has set Align.
Cfg int

ExponentNumbers

[0] / [1] GetCfgAttr SetCfgAttr
If set and the Number Type or Auto Type with number cannot be displayed whole and has not set Format, it is shown in exponential notation.
If there is no room either for the shortest exponent notation, it shows "###" as error.
1 - "0.########E+00", 2 - "0.########e+00", 3 - "0.########E+00" or "0E+0", "0E00", "0E0", 4 - "0.########e+00" or "0e+0", "0e00", "0e0".
Cfg int

ErrorNumbers

[1] GetCfgAttr SetCfgAttr
If set and the Number Type or Auto Type with number cannot be displayed whole and has set Format, it is shown in exponential notation or as "###" error.
0 - shows the number cut.
1 - shows the number in exponent format according to ExponentNumbers.
2 - shows "###" error if the number cannot show its all not decimal places in its format.
3 - shows "###" error if the number cannot be displayed whole in its format.
Format bits

StrictNumbers

[0]
1. bit, reserved.
2. bit, if set to 2, restricts entering hexadecimal values (number starting by 0x or x plus digits 0-9,a-f,A-F) in Number type.
3. bit, if set to 4, restricts entering percentage values (number ending by %) in Number type.
Grid method string

NumberToString

(number number, string format = "", int range = 0, bits type = 0)
Converts number to string according to format string like Format attribute.
If set range, the number can be range string with numbers, it is converted to range string with the individual numbers formatted.
For range = 2 uses ValueSeparatorDisplay and RangeSeparatorDisplay.
type controls the conversion, bit array:
1.bit &1 - formates slightly differently to use the result for editing.
2.bit &2 - does not return NaN for strings even if the format does not contain "@" part, used for Auto type.
3.bit &4 - returns one NaN for error in range. If not set, replaces by NaN only the incorrect number(s) in the range.
Grid method number

StringToNumber

(string string, string format = "", int range = 0, bits type = 0)
Converts string to number using format string like Format attribute.
Especially converts percentage values and replaces DecimalSeparator and GroupSeparator.
If set range, the string can be range string with numbers, it is converted to range string with the individual numbers converted.
For range = 2 uses ValueSeparatorDisplay and RangeSeparatorDisplay.
type controls the conversion, bit array:
1.bit &1 - converts strictly, if the string cannot be converted directly, returns NaN.
2.bit &2 - tests ExactNumbers.
3.bit &4 - returns NaN for error in range. If not set, replaces by NaN only the incorrect number(s) in the range.

Localization

The default number format and setting are specified in Texts.js, in Format object.
The default settings is for English language, changing the Format object attributes you can easily localize it to another language.
Format char

DecimalSeparator

["."]
The character displayed as floating point separator.
Format string

InputDecimalSeparators

[".,"]
The characters permitted to input as decimal separator. The first one is displayed for editing.
Format char

GroupSeparator

[","]
The character displayed as thousands separator.
Format string

InputGroupSeparators

[ ]
The characters permitted to input as group separator. The first one is displayed for editing if EditFormat contains group separator.
Format int

GroupCount

[3]
Count of digits separated by GroupSeparator
Format int

GroupCount1

[3]
Count of digits separated by GroupSeparator in the first group from right.
Format string

Percent

["%"]
The string used as percentage character to display and for editing.
Format string

Currency

["$"]
The string displayed by format dollar character. It is not used for editing.
Format string

FractionSeparator

["/"]
Separator use to separate fractions like "1/2".
Format string

NaN

["Error!"]
The string displayed for incorrect number for display.
Format string

NaNRange

["Range error!"]
The string displayed for incorrect number range for display if set RangeError & 1.
Format string

NaNInput

["e"]
The string displayed for incorrect number or number range for editing.
Format string

NaNFormat

["[red]@"]
Number Format to display the NaN and NaNRange. By default it colors the text red.