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

Input / output data

FastGrid documentation

Simple examples of creating FastGrid

Basics
The simplest page with FastGrid:
<html>
<head>
<script src="FGridE.js"> </script> <!-- including FastGrid script -->
</head>
<body>
<fast-grid style="height:300px;" src="[{ Cols:[ {id:'C1',Width:100}, {id:'C2',Width:150} ], Head:[{D:'Header'}], Body:[ {V:{C1:'V1',C2:'V2'}}, {V:{C1:'V3',C2:'V4'}} ] }]"> <!-- FastGrid main tag and data source definition -->
</body>
</html>


Creating by API
FastGrid is created after click to button Create:
<html>
<head>
<script src="FGridE.js"> </script> <!-- including FastGrid script -->
</head>
<body>
<div id="Main" style="height:300px;"> </div> <!-- FastGrid main tag with id -->
<button onclick='Create()'>Create</button>
<script>
function Create(){ // Creates FastGrid dynamically from JSON object in 'Main' tag
FGrid.FastGrid( [{ Cols:[ {id:'C1',Width:100}, {id:'C2',Width:150} ], Head:[{D:'Header'}], Body:[ {V:{C1:'V1',C2:'V2'}}, {V:{C1:'V3',C2:'V4'}} ] }], "Main" );
}
</script>
</body>
</html>


Version upgrade
When you are upgrading to new version or registered license or newly compiled script you can add some version info as query string to FGridE.js to ensure using the new one and suppress caching the old one, for example:
<script src="../Grid/FGridE.js?Version=2.0.12"> </script>

Create FastGrid

FGrid function Grid

FastGrid

(any src, any tag = null, function onfinish = null)
Creates new FastGrid, returns its object and starts its loading and rendering.

src contains json data or urls returning json data to load grid from.
src can be:
1)string as direct url or json data in string
For example: FGrid.FastGrid("../MyData/Data.json","tag")
or: FGrid.FastGrid("{Cols:['A','B','C'],Body:[{id:1,V:[1,2,3]},{id:2,V:[3,4,1]}]}","tag")
2)object without Sources,
Url and Data attributes
as direct json data or ByteArray data as xlsx content
For example: FGrid.FastGrid({Cols:['A','B','C'],Body:[{id:1,V:[1,2,3]},{id:2,V:[3,4,1]}]},"tag")
3)object with Url
or Data attribute
as Source object
For example: FGrid.FastGrid({Url:"../MyData/Data.json",Param:{P1:1,P2:"test"}},"tag")
4)array of items
1), 2), 3)
as array of string urls or json data strings or json objects or Source objects
For example: FGrid.FastGrid(["../MyData/Layout.json",{Cols:['A','B','C'],Body:[{id:1,V:[1,2,3]},{id:2,V:[3,4,1]}]},{Url:"../MyData/Data.json",Param:{P1:1,P2:"test"}}],"tag")
5)object with
Sources attribute
as Sources complex object with settings like Progress. Sources is array of items to load as array of string urls or json data strings or json objects or Source objects
For example: FGrid.FastGrid({Sources:["../MyData/Layout.json",{Cols:['A','B','C'],Body:[{id:1,V:[1,2,3]},{id:2,V:[3,4,1]}]},{Url:"../MyData/Data.json",Param:{P1:1,P2:"test"}}], Progress:100000},"tag")

tag specifies where FastGrid will be rendered.
tag can be:
1)stringas id of HTML element where the FastGrid will be rendered into its innerHTML. It will be set as main Tag.
2)HTMLElement
object
as HTML element where the FastGrid will be rendered into its innerHTML. It will be set as main Tag.
3)Arrayas Place Area to show FastGrid for this area as popup dialog.
4)Objectas standard FastGrid Sources / Source object like src types 2), 3) and 5). It is added to the end of src.
If set neither tag as HTMLElement / id nor Place Area / Tag, FastGrid is not rendered at all and to show it must be rendered by Render function.
If the tag is not set as HTMLElement / id, FastGrid cannot display informational messages during loading.

If set onfinish, the function is called after the grid is rendered as onfinish(Grid, Tag) or loaded (if not set tag, as onfinish(Grid)).

The tag should have set fixed CSS height in pixels to permit vertical scroll! Or if it should have resize to its parent tag fixed height, it should have set percentage height. See Grid size.
FGrid function void

StartFastGrid

( )
Processed all <fast-grid> tags that were deferred by defer attribute.
HTML HTMLElement

<fast-grid>

Custom HTML element that places FastGrid to the HTML page. It can be used instead of FGrid.FastGrid() to create FastGrid.
It should have set src attribute to load the data from.
<fast-grid> is standard HTML block tag and can have HTML attributes like id, class or style.
This tag will be set to the Tag attribute of the created FastGrid.
For example: <fast-grid src="['Def.js','Data.js']" style="border:1px solid red;height:500px;"/>
The <fast-grid> tag should have set fixed CSS height in pixels to permit vertical scroll! Or if it should have resize to its parent tag fixed height, it should have set percentage height. See Grid size.
<fast-grid> string

src

Contains json data or urls returning json data to load grid from. It is the same as FastGrid src parameter.
It is string, but can be set to JavaScript Source object or array in the string, starting by "[" or "{".
Examples: src="Data.js", src="['Def.js','Data.js']", src="[{Url:'Def.js',Method:'Get'},'Data.js']", src="{Source:['Def.js','Data.js]}"
<fast-grid> int

defer

If set to 0, does not process the tag automatically. To process it, call StartFastGrid.
If set to 1, processes the tag after document is fully loaded, in window onload.
If set to >=2, defers the tag processing by given number of milliseconds after the document is fully loaded.
Attribute defer > 0 calls StartFastGrid (in timeout or on window onload) that processes all <fast-grid> tags on page regardless on their defer attribute.
<fast-grid> string

onfinish

DOM event handler called after the grid is loaded and rendered. It is JavaScript code run after grid render. The same as FastGrid onfinish parameter.
The JavaScript code can use two variables, Grid as the created grid and Tag the <fast-grid> where the grid is placed.
For example <fast-grid src="Data.js" onfinish="console.log('Created grid '+Grid.id)"/>.
Source string

Url

Server url returning json data for FastGrid.
It can be any standard full or relative URI, on http://, https://, file://, data:, etc.
Source any

Data

Direct data to load to grid instead of downloading them from Url. The data can be:
a) string as json data in string or csv if set Format="csv".
b) object as json object or xlsx if the object is ByteArray.
Source string

Code

JavaScript code in string that returns the direct data. It is run in global scope. If it does not contain "return" statement, it is added on its beginning.
It is usually used in <fast-grid/>, for example <fast-grid src="[{Code:'MyGlobalObject.MyDef'},{Code:'MyGlobalObject.MyData'}]"/>.
The returned data can be:
a) string as json data in string or csv if set Format="csv".
b) object as json object or xlsx if the object is ByteArray.
Source string

Format

Data format, case insensitive. It can be set to json, xlsx, csv.
In input data it should be specified if it cannot be found out from the data or url.
The xlsx is chosen if the Url ends by ".xlsx" or the source contains direct data in ByteArray. The csv is chosen if the Url ends by ".csv". The json is chosen in all other cases.
Source string

Method

Method used for communication with Url, case insensitive:
null / "" - direct download using html <script> tag. With parameters in url.
get - AJAX using http GET method with parameters in http url.
post / form - AJAX using http POST method with parameters in http request.
The get / post / form is ignored and null is used if Url uses file:// protocol.
Source string / bool

Add

[0/1]
If set to anything except 0 or null, adds this attribute name with random value to the Url. To avoid caching the url by browser.
It can be set to 1 to add parameter named fgc.
By default it is set to 0 for post / form Method and to 1 for other methods.
Source string[id]

Param

Parameters sent with the request, set as name:value.
For Method = null / "" / "get" includes the parameters in Url with ?.
For Method = "post" / "form" includes the parameters in the http body request.
For example { Param: { Par1:"val1", Par2:"val2" } }
Source string[id]

Header

HTTP header parameters sent with the AJAX request, set as name:value. Used only if set Method.
Source bool

Sync

[0]
If set, uses synchronous AJAX communication. Used only if set Method.
Source string

User

Optional user name set in the AJAX request. Used only if set Method.
Source string

Pass

Optional password set in the AJAX request. Used only if set Method.
Source int

Safe

[0]
0 - uses JavaScript eval for parsing the input data. The format is less strict, but if the data contains JavaScript code, it is executed.
1 - uses JavaScript eval for parsing the input data, but fails if the json contains any functions calls, global assignments or function definitions. The format is still less strict than JSON parse. It also switches Method from null to get.
2 - uses safe JSON.parse for parsing the input data. It requires correct JSON format, but never runs any JavaScript code in data. It also switches Method from null to get.
Source bool

Encode

[0]
If set, encodes the < as &lt; and & as &amp; in all Param values.
Use to avoid the ASP.NET validation especially in save requests.
Source string / object

Error

If set and the communication fails, the Error is used as the response and the communication error is ignored.
Source int / object

Defer

If set to 1 or object, it does not load this source on grid loading, but loads it on background after grid is created and rendered. It uses LoadData method.
It can be set to object to display progress text in given FastGrid cell, with attributes: string Row, string Col (ids of cell or toolbar cell where to display the progress text), int Max (expected bytes to download), string Text = "$LoadingDataProgress", the text displayed in the cell.
Use to load large data on background, while grid first loads first small part of data and the rest is loaded on background while grid is fully usable.
After all the Defer are loaded, the OnLoadedData is called.

If set to 2 it loads the source on grid loading, but adds it later after grid partial initialization and loading cookies, just before sorting, grouping and filtering.
Sources any

Sources

Array of data to load to the grid. Items content can be as point 1) or 2) or 3) in FastGrid() src attribute.
For example: FGrid.FastGrid( { Sources: ["Def/Data2Def.js", { Url: "Data/Data2.js", Method:"Get" } ] }, tag)
Sources int

Progress

[0]
If set, it shows progress message during loading. It can be set only to the main object passed to the FastGrid, not to individual source items.
If set to >1, it is count of bytes to download, if the data source does not return its size.
It is applied only for AJAX communication - Method must be set for the data sources and the page must not run on file:// protocol.
For example: FGrid.FastGrid( { Sources: ["Def/Data2Def.js", { Url: "Data/Data2.js", Method:"Get" } ], Progress:156000000 }, tag)
Sources object

D

Default parameters added to all Source objects for AJAX communication in Sources.
For example: FGrid.FastGrid( { D: { Method:"Get", Safe:0 }, Sources: [ "Def.js", { Url:"Data/Data.js", Safe:1 } ] }, tag)
Grid method Sources

GetSources

(bits flags = 0)
Returns the original sources the grid was created from, the src parameter of the <fast-grid> or FastGrid().
If set flags&1, returns Sources property instead of the full src, if the src contained it.
API event object / string

OnDataSend

(Grid grid, Source source, function func, int index)
Called before starting communication with given source. It is called for any source, including static data.
Use for custom communication or to modify the data source parameters.
index is the index of the source in the loaded Sources.
Return null to continue without changes.
Or return {} to ignore this data source.
Or return new or modified source to load it instead.
Or return true for custom communication. In this case call function func(object / string data) with the loaded data or call func(string message, int error) in case of error.
API event object / string

OnDataGet

(Grid grid, Source source, object / string data, int index)
Called after successfully received and parsed data from given source. It is called for any source, including static data.
index is the index of the source in the loaded Sources.
The data is the parsed response. For JSON it is JavaScript object, for CSV it is string, for XLSX it is unzipped xlsx data.
Return new data to modify the response from server. The returned data can be JSON object or string, CSV string, raw XLSX byteArray or unzipped XLSX.
API event object

OnLoadError

(Grid grid, Source source, int code, string message, int index)
Called when loading any part of the data failed.
index is the index of the source in the loaded Sources.
Returning null or false will continue with fatal error.
Returning true will continue with ignoring this data source.
Returning JSON object will continue with it as a response from the errorneous data source.
source is the data source being loaded.
code is http error code <200 or >=300 in AJAX communication or negative as internal error code:
-1 - Communication aborted (AJAX)
-2 - Internal communication error (AJAX)
-3 - Timeout expired (AJAX)
-4 - Empty response (AJAX)
-5 - Invalid JSON data (script)
-6 - Not found (script)
-7 - Xlsx loaded on file protocol (xlsx)
-8 - Invalid xlsx data (xlsx)
-9 - Invalid csv data (csv)
-10 - Error loading imported file (import)
-11 - Unsupported file format (import)
-12 - Incorrect Code code or its execution failed (script)
API event object

OnDataError

(Grid grid, object data)
Called when the JSON data being added to grid contains IO Result < 0.
Returning null or false will continue normally and will add the data to grid.
Returning true will continue with ignoring this data.
Returning JSON object will add it to grid instead of data.
API event object

OnAddData

(Grid grid, object data)
Called before the JSON data are added to grid. It is not called for source JSON files like Defaults.js or Texts.js.
Returning null or false will continue normally and will add the data to grid.
Returning true will continue with ignoring this data.
Returning JSON object will add it to grid instead of data.
API event object

OnLoad

(Grid grid, int counter)
Called after all data to grid were loaded, but not updated / initialized yet. It is called directly before OnLoaded.
It can return new Sources / Source object / string / array, the same as src parameter in FastGridgrid data to load the sources.
If it returns something, it loads it and is called again with increased counter by 1. In the first call is the counter = 0.
It is called again and again while it does not return null!
API event object

OnLoaded

(Grid grid)
Called after all data to grid were loaded, but not updated / initialized yet. It is called directly after all OnLoad calls.
It can return new grid data to add to the grid like by call AddData.
It is often defined by FastGrid components like Menu or Calendar! In this case define the OnInit instead.
API event object

OnInit

(Grid grid)
Called after all data to grid were loaded, but not updated / initialized yet. It is called directly after OnLoaded.
It can return new grid data to add to the grid like by calling AddData.
API event void

OnInitialized

(Grid grid)
Called after all data to grid were loaded and initialized, but the grid was not updated and rendered yet.
API event void

OnUpdated

(Grid grid)
Called after all data to grid were loaded, initialized and updated (sorted, grouped, filtered ...), but the grid was not rendered yet.
API event HTMLElement

OnTag

(Grid grid, HTMLElement tag)
Called before the grid is rendered to the new tag or new grid is rendered to the same tag.
It is called for new rendered grid or when switched to new sheet in a Book or when imported new book to the grid. It is not called for grid dialog.
The tag is the DOM tag where the grid will be rendered to. It can be different than actual grid.Tag.
The handler can return another HTMLElement to render the grid to. The returned tag must be already in the DOM.
Called directly before OnRender, but not every OnRender.
It can be used to assign the grid object to some framework component, to contain always the displayed grid / sheet.
API event void

OnRender

(Grid grid, int type)
Called when starts rendering the grid. Called before every render (on Render, but not on every Paint).
type = 0 - called on every next re-render. 1 - called of the first render of normal grid. 2 - called on the first render of popup grid dialog.
API event void

OnReady

(Grid grid, bool first)
Called after the grid was fully rendered and is ready to use. Called after every render (on Render, but not on every Paint), first is set on the first render.
API event void

OnReadyAnimate

(Grid grid)
Called after animation of showing the grid as dialog finished and the grid receives events.
Grid method int

IsBusy

( )
Returns ready state of the grid:
-2 - grid is disposed and cannot be used, -1 grid was loaded with error and shows fatal error.
0 - grid is ready.
1 - grid is loading on start, 2 - grid is updating loaded data on start, 3 - grid is sorting, filtering, grouping,... on start, 4 - grid is rendering on start.
6 - grid is loading data on background by LoadData, 7 - grid is updating data loaded on background.
8 - grid is processing mouse or key event.
10 - grid is disabled or shows modal dialog or message, 11 - grid is not rendered (hidden).
Grid method void

AddData

(object data, bits options = 0)
Adds given data to the grid. data is full grid definition as standard response from FastGrid data source. It can be JSON object or JSON in string.
data can be also array of JSON objects or JSON strings to add all at once, especially if adding to initialized grid.
For example:grid.AddData({DefRows:{Test:{TextColor:"red"}},Body:[{id:17,D:"Test",V:[1,2,3,4]}]});
If set options&1, adds the data to grid Sources to be added also after reload.
If set options&2, accepts all changes set by the data: all row and column O attributes are processed, items with O&4 are removed, items with O&512 are selected / unselected and the O attribute is cleared in all items.
If set options&4, sorts, groups, filter and searches again the affected parts.
If set options&32, does not add any not existing rows or columns (like all them have Add=0).
AddData can be called during grid loading (the options&2+4 are ignored) or when grid is fully loaded.
Returns true if data was successfully added, otherwise returns false.
Grid method void

LoadData

(any src, function onfinish = null, any progress = null)
Loads data asynchronously to already fully loaded grid.
src is the data sources, the same as in FastGrid.
If set onfinish, the function is called after the data are loaded and added to grid, directly before Paint, as onfinish(Grid, result). The result is 0 for success and -1 for error.
progress can be function called during loading as progress(source, loaded, total, real), where source is the loaded Sources, loaded is reported loaded bytes count, total is total bytes to load from data source (it is often 0 as uknown!) and real is loaded characters count.
progress can be object to display progress text in given FastGrid cell, with attributes: string Row, string Col (ids of cell or toolbar cell where to display the progress text), int Max (expected bytes to download), string Text = "$LoadingDataProgress", the text displayed in the cell.
API event bool

OnLoadData

(Grid grid, any src, function onfinish)
Called when grid starts loading of Defer data source or source loaded by LoadData.
Return true to cancel loading. In this case the onfinish is not called and can be called by the event handler.
src and onfinish are parameters of LoadData.
API event void

OnLoadedData

(Grid grid)
Called after grid finished loading of Defer data source or source loaded by LoadData. It is called before Paint.
Grid method void

Dispose

(bool book = 0)
Clears the grid and frees all its resources.
It is called in setTimeout when called from FastGrid event handler of the reloaded grid or its dialog. For book = 1 disposes all grids in the grid's Book.
FGrid function void

DisposeGrids

( )
Disposes all grids on page. It is called in setTimeout when called from FastGrid event handler of the reloaded grid or its dialog.
Grid method void

Reload

(any src, bits type = 0, function onfinish = null, bool transparent = 0)
Reloads the grid.
If the grid is in Book, it reloads the whole book.
If not set src, reloads grid from the same sources.
If set src and type&1 = 0, reloads the grid with src data.
If set src and type&1 = 1, reloads the grid with the same data and next loads also src data. The src data are not added to original source data for next Reload.
If set type&2, does not preserve the grid id.
If set transparent, shows the disabled qrid semi transparent during reloading.
Other parameters are the same as in the FastGrid function.
It is called in setTimeout when called from FastGrid event handler of the reloaded grid or its dialog.
FGrid function any

AjaxCall

(any src, string data, function onfinish = null)
Universal function to do synchronous or asynchronous AJAX call to send data to and / or receive data from server.
src is server URL to communicate with. It can be absolute or relative, or even static local file.
src can be also JavaScript object as the FastGrid data source.
data is the data to send to server in parameter named Data.
If the onfinish is not set, the function does synchronous AJAX call and returns the received response. For error returns null.
If the onfinish is set, the function does asynchronous AJAX call and after finish it calls onfinish: function (response,error,src).
If the src contained more urls to load, the onfinish response and error or the function return are array of the restuls.
Actions

Reload

(int target = 0, bits flags = 0) OnClickReload
Reloads the grid from the same sources.
If the grid is in Book, it reloads the whole book.
If set flags&1, reloads the grid without confirmation message.
If set flags&2, reloads the grid without preserving actual configuration.
If set flags&4, reloads all grids with the same UndoId, if the grid has set UndoId and not set Book.
IO int

Result

[0]
It can be filled in the JSON data in IO tag. If set, OnDataError is called for this data.
IO string

Message

Message shown in grid after load as MessageD or as Ok message for Result>=0 or Error message for Result<0.
IO string

MessageD

Message default for IO Message.

Display grid

Grid variable object

Tag

FastGrid main tag - HTML tag where the grid is rendered into. It is set also if the grid is rendered as dialog.
Grid method bool

Render

(any tag)
Renders grid into given HTML tag. Sets the tag as the grid main Tag.
If the grid was rendered into another tag, clears the previous tag content and renders grid into the new tag.
tag can be the HTML tag object or its id as string.

The tag can be set also to JavaScript object as Place object with attribute Area to render the grid as a dialog.
For example grid.Render({Area:[100,200]}); will render the grid on position 100,200 on page.
Grid method bool

HideGrid

(bool clearhtml = 0, int closedialog = 0)
Hides the grid. If the grid is shown as dialog, hides the whole dialog. Otherwise it hides content of the main Tag.
For clearhtml = 0 it sets display:none to the grid content tag. For clearhtml = 1 it clear the whole html from the main Tag.
If set closedialog it closes the grid Dialog and finishes editing, if any. For closedialog = 2 it forces closing the dialog and finishing editing.
Returns true for success. Returns false if the grid is already hidden or dialog cannot be closed or editing cannot be finished.
Grid method bool

ShowGrid

( )
Shows grid hidden by HideGrid. Returns true for success. Returns false if the grid is not hidden or cannot be shown (has not set Tag).
API event bool

OnHideGrid

(Grid grid, bool clearhtml, bool force)
Called before the grid is hidden, e.g. on sheet switch. Return true to suppress the hiding.
For clearhtml = 0 it sets display:none to the grid content tag. For clearhtml = 1 it clear the whole html from the main Tag.
For force = 1 it will ignore the return value and will hide the grid always.
API event void

OnHidGrid

(Grid grid, bool clearhtml)
Called after the grid was hidden.
For clearhtml = 0 it sets display:none to the grid content tag. For clearhtml = 1 it clear the whole html from the main Tag.
API event bool

OnShowGrid

(Grid grid, bool clearhtml)
Called before the grid is shown by ShowGrid, e.g. on sheet switch. It is not called on render. Return true to suppress the showing.
For clearhtml = 0 it sets display:none to the grid content tag. For clearhtml = 1 it clear the whole html from the main Tag.
API event void

OnShowedGrid

(Grid grid)
Called after the grid was shown. It is not called on render.

Access grid by API

Cfg string

id

[...] GetCfgAttr
Unique grid identification. It must not be number. By the id the grid can be accessible in global FGrid.Grids array, as FGrid.Grids[id].
The id cannot be changed. If defined more times in input data, the first definition is used and the others are ignored.
If created grid with already existing id, the old grid is disposed.
If not defined the id attribute, it is generated as Grid + Index, the index can be assigned higher if the grid already exists.
If not defined the id attribute in Book, it is generated as Text.$DefaultSheet with replaced the first number by the Index, the index can be assigned higher if the grid already exists.
Grid int

Index

Unique generated grid number index. By the index the grid can be accessible in global FGrid.Grids array, as FGrid.Grids[index].
FGrid variable Grid[]

Grids

Contains all defined grids on page. Every grid is included twice or three time, once by its id, once by its Index and optionally once by id in lower case.
To iterate all grids on page use loop for(var i=0;i<FGrid.Grids.length;i++) if(FGrid.Grids[i]){ ... }.
In some environments like React it is required to access the global variables as window properties: window.FGrid.Grids.
global variable object

FGrid

Global object with all FastGrid global setting. It contains especially defined API event handlers and array of all grids in Grids.
It is the only global JavaScript object FastGrid defines and uses.
In some environments like React it is required to access the global variables as window properties: window.FGrid.

Sheets - more grids switched in one place

It is possible to load more grids at once and display one of them in the destination Tag and switch the display using toolbar "Sheets".

To load more sheets at once, specify different Sheet per loaded data source - it will create more grids.
Or specify Sheets attribute to load more sheets from one data source.
Or specify xlsx file as data source.

Global dialog to manage sheets can be shown by Grid.ShowDialog(null,null,'Sheets').
Source string

Sheet

[null / "*"]
Sheet id the Source is loaded to.
If the grid has not set its id yet, the Sheet is set to the grid id and the data source is loaded into this grid.
If the grid has the same id as the Sheet, the source is loaded into this grid.
If the grid has different id than the Sheet, the source is loaded into the other grid with given Sheet id. If such grid does not exist yet, it is created first.
It can be set to comma separated string or array of strings of sheet ids to load the data source to more sheets.
It can be set to "+" to load the data source to hidden sheet that will be used as source for newly added sheets by AddSheet toolbar button.
It can be set to "*" to load the data source to every sheet loaded in this data source, including the new sheet.
For example FGrid.FastGrid([ { Sheets: [ "Sheet2", { Sheet:"Sheet1", Cfg: { Active:1 } } ] }, { Sheet:"Sheet1,+", Url: "../Def/Data1Def.js"}, { Sheet:"Sheet1", Url:"../Data/Data1x1000.js" }, { Sheet:"Sheet2", Url:"../Def/Data2Def.js" }, { Sheet:"Sheet2", Url:"../Data/Data2x1000.js" } ],"maintag");
If any of input data has Format = "xlsx", default value of the Sheet in all other input data sources is "*" to apply them to all sheets; otherwise the Sheet is null.
Grid string

Sheet

The Sheet can be set also in the root attribute in the JSON data, its meaning is the same as Source Sheet. If set both, the Source Sheet is preferred.
Cfg string

Sheet

The Sheet can be set also in the Cfg attribute in the JSON data, its meaning is the same as Source Sheet. If set both, the Source Sheet is preferred.
It can be placed only to Cfg tag without any sufffix _xxx!
Grid any

Sheets

Data for next sheets loaded with this grid. It can be set:

a) It can be comma separated string of the sheet id, used just to specify order of the sheets loaded in other data sources.
For example { Sheets:"Sheet1,Sheet2,Sheet3", Sheet:"Sheet1", Cfg: {...}, Cols: [...], Body: [...] }

b) JavaScript array of full grid JSON datas for the other sheets. Every the data object should have set the Sheet attribute to load it to the given sheet.
For example { Sheets: [ { Sheet:"Sheet1", Cols: [...] }, { Sheet:"Sheet1", Body: [...] }, { Sheet:"Sheet2", Cols:[...], Body:[...] }, { Sheet:"Sheet3", Cols:[...] } ], Sheet:"Sheet3", Body:[...] }

c) JavaScript object as named array of the full grid JSON datas by sheet id.
For example { Sheets: { Sheet1: { Cols: [...], Body: [...] }, Sheet2: { Cols:[...], Body:[...] }, Sheet3: { Cols:[...] } }, Sheet:"Sheet3", Body:[...] }

The Sheets tag cannot be set with suffix _xxx to have defined more Sheets tags!
Cfg any

Sheets

The Sheets can be set also in the Cfg attribute in the JSON data, its meaning is the same as Source Sheets. If set both, the Source Sheets is preferred.
The Sheets tag cannot be set with suffix _xxx to have defined more Sheets tags!
Cfg string

Book

["1"]
Workbook id the Sheet belongs to. Use when there are more books in one web page. By default all data sources have set Book from the first loaded grid, by default it is "1".
It can be placed only to Cfg tag without any suffix _xxx!
Cfg bool

Active

If set, the sheet is the one active sheet that is displayed in the Book. If no sheet has set Active, the main loaded grid is active.
Cfg int

Hidden

If set, the sheet id is not displayed on the "Sheets" toolbar.
If set to 2, the sheet id cannot be displayed on the "Sheets" toolbar.
Cfg int

SheetIndex

Specifies index of the sheet displayed in "Sheets" toolbar. Use to override the order specified by loading data sources and Sheets definition.
The SheetIndex can be any number, the toolbar just sorts the sheets according to their SheetIndex.
The SheetIndex is automatically modified on paint!
Cfg bits

ChangingSheets

[0] / [31 = 1+2+4+8+16]
How the sheets can be managed:
1.bit &1 - sheets can be added.
2.bit &2 - sheets can be deleted.
3.bit &4 - sheet tab can be moved.
4.bit &8 - sheet name can be edited.
5.bit &16 - sheet can be shown / hidden.
Cfg int

ShareCfg

[1] GetCfgAttr SetCfgAttr
If all the grid configuration changes are saved to all sheets in Book. It should be set the same in all the sheets.
If set to 2, it also shares chosen columns (visible and for print, export, copy &paste).
Cfg bool

SheetJs

[0]
If set, loads xlsx configuration from Sheet.js in grid that does not load xlsx file. Applied only if set also Book.
It can be placed only to Cfg tag without any suffix _xxx!
Toolbar string

D

=

"Sheets"

Default toolbar to show sheets (all grids on page with the same Book as this grid).
The "Sheets" toolbar displays AddSheet button to add new sheet if some data source was loaded for Sheet with "+" id.
The "Sheets" toolbar provides features: to activate (display) another sheet, to change the sheets order, to rename sheet, to delete sheet and to add new sheet.
Grid method Grid

GetActiveSheet

( )
Returns active (displayed) sheet in this grid Book.
For single grid without Book returns this grid.
To activate another sheet call ShowGrid() of the sheet that should be activated.
Grid method Grid[]

GetSheets

(bits sort = 0, bool nohidden = 0)
Returns all sheets in this grid Book.
If set sort&1, sorts the array according to the SheetIndex.
If set sort&2, sets SheetIndex in all the returned grids to the index in the returned array.
If set sort&4, returns sheet ids instead of Grid objects.
If set nohidden = 1, returns only grids that have not set Hidden attribute.
For single grid without Book returns one item array with this grid.
Grid method void

MoveSheet

(Grid next)
Moves actual sheet before the next on "Sheets" toolbar by updating SheetIndex.
Grid method void

SetGridId

(string id, bool update = 0)
Changed the grid id and the sheet name. Called on rename sheet on "Sheets" toolbar.
If the id is number or empty, it adds one space on its end. If there already exists grid with the id, it modifies or add index on the end.
If set update, updates editable formulas and names in all sheets in the book that referring old id to refer new id.
Actions

DeleteSheet

(int target = 0, bool hideonly = 0) OnClickDeleteSheet
Deletes actual clicked sheet.
If set hideonly, only makes the the sheet hidden and shows another one.
To hide the delete icon on the sheet button set DefTools:{ Sheet: { IconFormula:"0" } }.
Grid method bool

DeleteSheet

(bool hideonly = 0, bool nopaint = 0, bool noadd = 0)
Deletes this grid and updates active sheet. If this grid is active sheet, shows the previous or first sheet.
If this grid is the only sheet in its Book, it adds new empty sheet or fails if set noadd.
It fails, if the grid is not in Book.
If set hideonly, only makes the the sheet hidden and shows another one.
Actions

AddSheet

(int target = 0, string id = "$NewSheet") OnClickAddSheet
Creates new sheet with given id in this grid Book and shows the new sheet.
If there already exists grid with the given id, it adds number suffix to the id.
New sheet is created from the layout loaded with Sheet="+".
Grid method Grid

AddSheet

(string id = "$NewSheet", int noshow = 0)
Creates new sheet with given id in this grid Book.
If there already exists grid with the given id, it adds number suffix to the id.
New sheet is created from the layout loaded with Sheet="+".
If set noshow = 0, shows and paints the new sheet, for 1 it does not show the new sheet, but paint actual grid, for 2 it does not show the new sheet and does not paint actual grid.
Grid method void

IterSheets

(function func, any[] parameters = null, bits type = 0)
Calls function func for every sheet (grid). It calls it as a method of the sheet.
If set type&1, it calls it for every sheet if set ShareCfg, otherwise it calls it only for this one sheet that calls the IterSheet.
If set type&2, it calls the func as normal function and passes the sheet as the first parameter.
If set type&4, it does not call the func for this sheet that calls the IterSheet.
The parameters is an array of parameters the function func receives.

Layout and configuration

Input data are always defined as JSON in this special header:
FGrid.Data = { ... }
For example:
FGrid.Data = { Cfg: { SelectedRows:"1,3,4" }, Body: [{id:1,V:[1,4,5]},{id:2,V:[4,1,2]},{id:3,V:["A",3,4]}] }
FGrid object

Data

Base object in every input JSON data
Input data are always defined as JSON in this special header:
FGrid.Data = { ... }
For example:
FGrid.Data = { Cfg: { SelectedRows:"1,3,4" }, Body: [{id:1,V:[1,4,5]},{id:2,V:[4,1,2]},{id:3,V:["A",3,4]}] }
Grid object

Cfg

Base definition in Defaults.js.
FastGrid base configuration.
Contains mostly string and integer type attributes, but some attributes can be also objects.
The most of the Cfg attributes can be read by Get / GetCfgAttr and set by Set / SetCfgAttr.
Grid object

Format

Base definition in Texts.js
Language specific settings, especially for numbers and dates.
Contains string or integer type attributes. Cannot be read or written by API.
Grid string[id]

Text

Base definition in Texts.js
All FastGrid texts for translations, language specific.
Contains string type attributes. Can be read by GetTagAttr and written by SetTagAttr.
Grid string[id]

Actions

Base definition in Defaults.js
Mouse and key action schema. Defines base handlers for FastGrid mouse and key events.
Contains string type attributes. Can be read by GetTagAttr and written by SetTagAttr.
Grid object[]

RowParts

Base definition in Defaults.js
Horizontal layout, defines order of row parts, toolbar parts, column tree parts and horizontal scrollbar.See more information at RowParts.
Array of objects. Cannot be read or written by API.
Grid object[]

ColParts

Base definition in Defaults.js
Vertical layout, defines order of column parts and vertical scrollbar. See more information at ColParts.
Array of objects. Cannot be read or written by API.
Grid object[id]

Styles

Base definition in Styles.js
Configuration attributes for individual styles set by Style.
Contains object type attributes as the same tags in Grid like Colors, Borders, TextStyles, ... Cannot be read or written by API.
Grid object[id]

TextStyles

Base definition in Styles.js
Configuration attributes for styling text. Values used in TextStyle and TextSize definitions.
Contains integer type attributes. Can be read by GetTagAttr and written by SetTagAttr.
Grid string[id]

Colors

Base definition in Styles.js
All RGB colors used in FastGrid, including in icons.
Contains string type attributes. Can be read by GetTagAttr and written by SetTagAttr.
Grid int[id]

Borders

Base definition in Styles.js
Border widths in pixels. For all FastGrid lines and borders.
Contains integer type attributes. Can be read by GetTagAttr and written by SetTagAttr.
Grid object[id]

CellBorders

Base definition in Styles.js
Border definitions that can be assigned to CellBorder attribute.
Contains object type attributes as cell border definition by their id. Cannot be read or written by API.
Grid Icon[id]

Icons

Base definition in Styles.js
All icons defined in FastGrid.
Contains object type attributes as icon definition by their id. Cannot be read or written by API.
Grid string[id]

Cursors

Base definition in Styles.js
Mouse cursor assigned for specific action.
Contains string type attributes as CSS cursor name by the action id. Can be read by GetTagAttr and written by SetTagAttr.
Grid string[id]

SvgDefs

Base definition in Styles.js
Icons extension, adds the strings as they are to SVG <defs> if they are referred by def attribute in Icons. Cannot be read or written by API.
The strings can contain SVG object definition to refer them in icons: <pattern>, <linearGradient>, <radialGradient>, <marker>, <mask>, <clipPath>, <filter>.
Grid object

Font

Base definition in Styles.js.
Defines base font used for all FastGrid texts. And defines shared settings for all other fonts set by TextFont.
Contains mostly string and integer type attributes, but some attributes can be also objects. Cannot be read or written by API. Cannot be set in added input data by AddData after grid is initialized.
Grid Image[id]

DefImages

Base definition in Defaults.js
Default settings for all row cell images in FastGrid
Contains object type attributes as image definition by their id. Cannot be read or written by API.
Grid Tool[id]

DefTools

Base definition in Defaults.js
Defined default toolbar cells that can be assigned to Tool. See more information at DefTools.
Contains object type attributes as Tool definition by their id. Cannot be read or written by API.
Grid Toolbar[id]

DefToolbars

Base definition in Defaults.js
Defined default toolbars that can be assigned to Toolbar. See more information at DefToolbars.
Contains object type attributes as Toolbar definition by their id. Cannot be read or written by API.
Grid Cell[id]

DefCells

Base definition in Defaults.js
Defined default cells that can be assigned to Cell. See more information at DefCells.
Contains object type attributes as Cell definition by their id. Cannot be read or written by API.
Grid Row[id]

DefRows

Base definition in Defaults.js
Defined default rows that can be assigned to Row. See more information at DefRows.
Contains object type attributes as Row definition by their id. Cannot be read or written by API.
Grid Col[id]

DefCols

Base definition in Defaults.js
Defined default columns that can be assigned to Col. See more information at DefCols.
Contains object type attributes as Col definition by their id. Cannot be read or written by API.
Grid Dialog[id]

Dialogs

Base definition in Defaults.js
All predefined dialogs, menus, calendar, etc. It contains named array of all the Dialog objects their names can be used in D when showing dialog.
Contains object type attributes as Dialog definition by their id. Cannot be read or written by API.
Grid Message[id]

Messages

Base definition in Defaults.js
All predefined messages. It contains named array of all the Message objects their names can be used in D when showing message.
Contains object type attributes as Message definition by their id. Cannot be read or written by API.
Grid object

Script

Custom scripts definition
Assigns all the defined attributes to Grid.Scripts.
Cannot be used with Safe:1
Use for defining custom functions like:
{ Script: { MyFunc: function(a,b,c){ return a*b/(a+c); } } } and use e.g. in formula like Formula:"Grid.Script.MyFunc(1,3,6)"
Grid object

Events

Local API events definition
Assigns all the defined functions to the grid API events by AddEvent.
All the attribute names must start by "On".
Cannot be used with Safe:1
Use for defining local API events assigned to only this grid like:
{ Events: { OnClick: function(G,row,col){ alert("Clicked cell "+Row.id+","+Col.id); } } }
It is not possible to define both global and local event handler for the same event!
Grid object

FGrid

Global custom scripts and API events definition
Assigns all the defined attributes to global variable FGrid.
Cannot be used with Safe:1
Use for defining global API events assigned to all grids like:
{ FGrid: { OnClick: function(G,row,col){ alert("Clicked cell "+Row.id+","+Col.id); } } }
It is not possible to define both global and local event handler for the same event!

Data rows, columns, toolbars and images

Grid Row[]

Body / Head / Foot / {rowpartid} / {rowpartid}${colsetid}

Rows are placed in RowPart definition of Type="Rows" as array.
Rows usually define also their cell values, formulas, attributes and span in V, U, F, E, A, B, RS, CS and M.
The row parts are defined in RowParts. The predefined row parts of type "Rows" are: Head, Body and Foot, but it is possible to define any other row parts.
For example: Body:[{id:1,V:{A:"A1"}},{id:2,V:{A:"A2"}}].
To define rows for other column set, define them with $colset suffixe, e.g. Body$Set2:[{...},{...},{...}]
Grid Col[]

Cols / LeftCols / RightCols / {colpartid} / {colpartid}${rowsetid}

Columns are placed in ColPart definition of Type="Cols" as array.
The column parts are defined in ColParts. The predefined column parts of type "Cols" are: LeftCols, Cols and RightCols, but it is possible to define any other column parts.
For example: LeftCols:[{id:"A",Type:"String"},{id:"B",Type:"Number",Format:"0.00"}].
To define columns for other row set, define them with $rowset suffixe, e.g. Cols$Set2:[{...},{...},{...}]
Grid Toolbar[]

Top / Bottom / {rowpartid}

Toolbars are placed in RowPart definition of Type="Toolbars" as array.
The toolbar parts are defined in RowParts. The predefined row parts of type "Toolbars" are: Top and Bottom, but it is possible to define any other row parts.
For example: Top:["Data","Style",{id:"Custom",Cells:[{id:"A",Type:"String",Width:100}]}].
Grid Image[]

Images

Definition list of all images in FastGrid. It contains array of Image objects.
Grid Row[]

ChangedRows

In tag ChangedRows are placed changed rows when uploading changed data to server or calling GetData("changes").
The ChangedRows tag in input data is processed the same as Body, Head, Foot, ... tags, but the items must have set Prev or Next attribute to specify the part to place the row to.
Grid Col[]

ChangedCols

In tag ChangedCols are placed changed columns when uploading changed data to server or calling GetData("changes").
The ChangedCols tag in input data is processed the same as Cols, LeftCols, RightCols, ... tags, but the items must have set Prev or Next attribute to specify the part to place the column to.
Grid Tool[]

ChangedTools

In tag Tools are placed changed toolbar cells when uploading changed data to server or calling GetData("changes").
The toolbar cells must have set Prev attribute to specify toolbar where they are placed.

Changes in data rows, columns, toolbars and images

If the row, column or toolbar with the same id already exists in grid, it just sets all the attributes from new item to existing item.
The existing item is not moved, except if the new item has set Next, Prev or Parent.
The values in row / column array attributes V, E, F, RS, CS and M are copied from new item to existing item individually.
The row / column attributes values in array attribute A are copied from new item to existing item individually also on attribute level, if the new item attribute is object.
The toolbar Cells are copied individually and can also define Next, Prev and Remove attributes to control the position.

Output by Changed / Changes SaveFlags

To the ChangedRows / ChangedCols are filled rows / columns with these attributes, in this order:

Base
01. id: id - The item id. The only attribute filled always.
02. O: num - Item changes flags. Filled if not set NoO.

Removed row / column
03. Remove: 1 - The item is deleted. The item never contains any other attributes except O: 4.

Added / moved row / column
04. Next: id - The item is moved or added before the Next item.
05. Prev: id - The item is moved or added after the Prev item.
06. Parent: id - The item is moved or added as the last child of the Parent, position can be more specified by Next / Prev. Sets L as +1 of the Parent.
07. Part: id{$setid} - The item is moved or added into the Part part, as the last item, position can be more specified by Next / Prev.
08. L: num - The item level in tree.
09. S: num - The item set, if not 0.
10. D: id - The new default item id that was changed.
11. Add: 0 / 1 - The item has been moved or added.

Changed cells in row
12. V: { cell values per column id } - The row cell values changed.
13. E: { cell formulas per column id } - The row cell editable formulas changed.
14. A: { cell attribute objects per column id } - The row cell style attributes changed, e.g. A: { Col3: { Align:2, Color:"red" }, Col5: { TextStyle:1 } }. If set Normalize, it contains default attribute ids instead of objects like A: { Col3:13, Col5:"DC5" }
15. RS: { cell row span per column id } - The cell row span changed.
16. CS: { cell column span per column id } - The cell column span changed.

Changed row / column
17. Height: num - The resized row height or resized column width.
18. Hidden: 0 / 1 - The item is shown or hidden.
19. Collapsed: 0 / 1 - The item children are expanded or collapsed.
20. Selected: 0 / 1 - The item is unselected or selected.
21. attribute: value - The row / column style attributes values that have been changed.

Regex to parse the ChangedRows / ChangedCols - parses one row / column to 22 attribute values in the order listed above. The value can be number as is or string in " " or object in { }.
as JavaScript RegExp /.../:
/\{(?:"?id"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))(?:,"?O"?:(\d+))?(?:,"?Remove"?:(\d+))?(?:,"?Next"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))?(?:,"?Prev"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))?(?:,"?Parent"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))?(?:,"?Part"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))?(?:,"?L"?:(\d+))?(?:,"?S"?:(\d+))?(?:,"?D"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))?(?:,"?Add"?:(\d+))?(?:,"?V"?:\{((?:"(?:\\.|[^"])*"|[^"\}]+)*)\})?(?:,"?E"?:\{((?:"(?:\\.|[^"])*"|[^"\}]+)*)\})?(?:,"?A"?:\{((?:"(?:\\.|[^"])*"|\{(?:"(?:\\.|[^"])*"|[^"\}])*\}|[^"\{\}]+)*)\})?(?:,"?RS"?:\{([^\}]+)\})?(?:,"?CS"?:\{([^\}]+)\})?(?:,"?(?:Height|Width)"?:(\d+))?(?:,"?Hidden"?:(\d+))?(?:,"?Collapsed"?:(\d+))?(?:,"?Selected"?:(\d+))?(?:(?:,"?\w{3,}"?:("(?:\\.|[^"])*"|[\+\-\.\w]+))*)/
as ASP.NET @"..."
@"\{(?:""?id""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))(?:,""?O""?:(\d+))?(?:,""?Remove""?:(\d+))?(?:,""?Next""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))?(?:,""?Prev""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))?(?:,""?Parent""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))?(?:,""?Part""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))?(?:,""?L""?:(\d+))?(?:,""?S""?:(\d+))?(?:,""?D""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))?(?:,""?Add""?:(\d+))?(?:,""?V""?:\{((?:""(?:\\.|[^""])*""|[^""\}]+)*)\})?(?:,""?E""?:\{((?:""(?:\\.|[^""])*""|[^""\}]+)*)\})?(?:,""?A""?:\{((?:""(?:\\.|[^""])*""|\{(?:""(?:\\.|[^""])*""|[^""\}])*\}|[^""\{\}]+)*)\})?(?:,""?RS""?:\{([^\}]+)\})?(?:,""?CS""?:\{([^\}]+)\})?(?:,""?(?:Height|Width)""?:(\d+))?(?:,""?Hidden""?:(\d+))?(?:,""?Collapsed""?:(\d+))?(?:,""?Selected""?:(\d+))?(?:(?:,""?\w{3,}""?:(""(?:\\.|[^""])*""|[\+\-\.\w]+))*)"
as JAVA "..."
"\\{(?:\"?id\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))(?:,\"?O\"?:(\\d+))?(?:,\"?Remove\"?:(\\d+))?(?:,\"?Next\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))?(?:,\"?Prev\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))?(?:,\"?Parent\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))?(?:,\"?Part\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))?(?:,\"?L\"?:(\\d+))?(?:,\"?S\"?:(\\d+))?(?:,\"?D\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))?(?:,\"?Add\"?:(\\d+))?(?:,\"?V\"?:\\{((?:\"(?:\\\\.|[^\"])*\"|[^\"\\}]+)*)\\})?(?:,\"?E\"?:\\{((?:\"(?:\\\\.|[^\"])*\"|[^\"\\}]+)*)\\})?(?:,\"?A\"?:\\{((?:\"(?:\\\\.|[^\"])*\"|\\{(?:\"(?:\\\\.|[^\"])*\"|[^\"\\}])*\\}|[^\"\\{\\}]+)*)\\})?(?:,\"?RS\"?:\\{([^\\}]+)\\})?(?:,\"?CS\"?:\\{([^\\}]+)\\})?(?:,\"?(?:Height|Width)\"?:(\\d+))?(?:,\"?Hidden\"?:(\\d+))?(?:,\"?Collapsed\"?:(\\d+))?(?:,\"?Selected\"?:(\\d+))?(?:(?:,\"?\\w{3,}\"?:(\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+))*)"

Regex to parse value of V [12], E [13], normalized A [14] or one A item in {}, RS [15], CS [16], attributes [22] - parses it to one single array as [colid1,value1,colid2,value2,...], value can be number as is or string in " ". colid is in " " only if it contains other character than [a-zA-Z0-9_].
as JavaScript RegExp /.../:
/"(?:\\.|[^"])*"|[\+\-\.\w]+/g
as ASP.NET @"..."
@"""(?:\\.|[^""])*""|[\+\-\.\w]+"
as JAVA "..."
"\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+"

Regex to parse not normalized A [14] - parses it to one single array as [colid1,value1,colid2,value2,...], value can be number as is or string in " " or object in { }. colid is in " " only if it contains other character than [a-zA-Z0-9_].
as JavaScript RegExp /.../:
/"(?:\\.|[^"])*"|[\+\-\.\w]+|\{(?:"(?:\\\\|\\"|[^"])*"|[^"\{\}]+)*\}/g
as ASP.NET @"..."
@"""(?:\\.|[^""])*""|[\+\-\.\w]+|\{(?:""(?:\\\\|\\""|[^""])*""|[^""\{\}]+)*\}"
as JAVA "..."
"\"(?:\\\\.|[^\"])*\"|[\\+\\-\\.\\w]+|\\{(?:\"(?:\\\\\\\\|\\\\\"|[^\"])*\"|[^\"\\{\\}]+)*\\}"
?? Row, Col, Toolbar, Tool, Part string / int

Next

Places the item (row, column, toolbar, toolbar cell, row part or col part) before the item with id = Next.
If the Next item does not exist, places the item as the last item in the part or parent.
If used in many rows / columns in data during FastGrid creating, it can remarkably slow down the creating!

If the parent contains the first item as "", it automatically sets to all items in the section Next:"" to reorder already existing items in given order.
For example: Cols:["","A",{id:"B",Width:100},"C"] is taken as Cols:[{id:"A",Next:""},{id:"B",Width:100,Next:""},{id:"C",Next:""}]
?? Row, Col, Toolbar, Tool, Part string / int

Prev

Places the item (row, column, toolbar, toolbar cell, row part or col part) after the item with id = Prev.
It is ignored, if the Next attribute is defined.
If the Prev item does not exist, places the item as the first item in the part or parent.
If used in many rows / columns in data during FastGrid creating, it can remarkably slow down the creating!
?? Row, Col string / int

Parent

Specifies parent or part of the row / column.
If set Next and not set L, just changes the row or column L to the Prev.L + 1.
Otherwise places the row or column as the last child of the row / column with id = Prev or as the last row in Part Prev.
If the P row / column / part does not exist, does nothing.
If used in many rows / columns in data during FastGrid creating, it can remarkably slow down the creating!
Row, Col string

Part

Part id where the row / column is placed. It can contain also Set as {Part_id$Set_id}, e.g. Part:"Body$2".
If it is not set and Parent/Prev/Next are also not set, the added row / column is placed to DefRowPart / DefColPart.
Row string / int

NewId

It can be filled only in response sent from server to FastGrid.
It changes the row id to this value.
Tool string

Toolbar

Toolbar where the cell is placed in, used in changed toolbar cells in ChangedTools tag.
Image int

Index

If set, places the image to given index. If there is already an image on the index, merges the images according to the Remove value.
Row, Col, Toolbar, Tool, Image, Part int

Remove

[0]
What to do if there is item (row / column / toolbar / toolbar cell / image / row part / col part) with the same id already in the grid.
0changeChanges the existing item attributes by the new item attributes. To also move the item set Prev / Next attribute.
1removeRemoves the existing item and does not add the new item.
2remove + addRemoves the existing item and places the new item on its new position.
3replaceRemoves the existing item and places the new item instead of the removed item.
Row, Col, Toolbar, Tool, Image, Part bool

Add

[1]
If adds the new item when it does not exist in the grid yet. By default is true.
Toolbar, Tool bool

All

If set and the toolbar cell does not exist in its toolbar yet, it is searched in all toolbars. If found only once, it is removed from old destination and added to its toolbar, even if it has set Add = 0.
The toolbar cells should have set their ids unique among all toolbars.
Row, Col bits

O

GetAttr
Actual state of the row or column:
&1 - any row cell changed according to the CellChanges. It is not set in column!
&2 - added
&4 - deleted - will be removed after accepting changes
&24 - moved ( 8 - moved with parent, 16 - moved inside parent, 24 - moved to another parent or every move) according to RowChanges / ColChanges &24.
&32 - resized
&64 - shown / hidden. See also Hidden attribute.
&128 - changed row / column style attribute (e.g. Color or TextSize).
&256 - expanded / collapsed children. See also Collapsed.
&512 - selected / unselected. See also Selected attribute.
&1024 - row / column added by Auto part.
&2048 - manually hidden row / column if it does not have set NoHide.
Grid method string / object

GetData

(string flags = SaveFlags, int format = 0)
Returns FastGrid data according to the flags in given format. The returned data can be passed back to FastGrid in its input data or by AddData.
format = returned format = 0 - json in string, 1 - json object.
flags - what and how is filled in returned data, comma separated list or array of string flags, cases insensitive.
flags for changes
Changed Fills changed rows in ChangedRows array (if set RowChanges or CellChanges).
Fills changed columns in ChangedCols array (if set ColChanges).
Fills changes toolbar cells in ChangedTools array (if set ToolChanges).
Changes Fills changed rows, column and toolbars to their parts instead of ChangedRows / ChangedCols / ChangedTools. Ignored if set Changed flag.
 
StateFills also attributes Add=1 for added item (O&2), Remove=1 for deleted item (O&4), Add=0 for moved item (O&24), Hidden=1 for O&64, Collapsed=1 for O&256, Selected=1 for O&512.
Note, for resized item (O&32) is always filled attribute Width or Height.
NoODoes not fill O attribute. It still fills O values 2 (added) and 4 (removed) if not set State flag.
NoLDoes not fill L attribute.
NoL0Does not fill zero value in L attribute.
Reverse If not present, fills the changed items in normal (not reversed) order. Fills always the Prev attribute for moved / added rows, except if set Next flag without Prev.
If present, fills the items in reversed order, so the Next always points to already created or moved items. Fills always the Next attribute for moved / added rows, except if set Prev flag without Next.
ParentFills parent row / column in the Parent attribute. Never fills it for root rows / columns.
NextFills the next row / column in the Next attribute either without flag Reverse. Does not fill Prev except if set flag Prev.
PrevFills the previous row / column in the Prev attribute either with flag Reverse. Does not fill Next except if set flag Next.
DefPartFills the Part attribute also for rows in part DefRowPart and for columns in part DefColPart.
AddVFills all cell values for added rows. For not set values fills empty string. Can be used also with VArray and Def flags.
NormalizeNormalize attributes in A tag when filling cell attributes in rows.
Fills the A always with number references to DefCells instead of attribute objects.
Fills also all the added default cells in DefCells, but only once (they will not be uploaded in next uploads).
ParentId Fills parent row / column id in the id, Parent, Next and Prev attributes. For root row / column adds nothing. Seaparates the ids by SaveIdSeparator.
Cannot be used for moved rows / column if set RowChanges / ColChanges & 24 (only 8 and 16 bit values are permitted here).
flags for full data
{partid}Fills all rows, column or toolbar from given part in the array named as the part.
For example GetData("Body,Cols") returns {Body:[...],Cols:[...]} as all rows from Body part and all columns from Cols part.
The cells are filled in rows in V / U / A / B / E / F / RS / CS / M attributes.
In toolbars the cells are filled in Cells array.
Columns never contain cells.
The rows / columns / toolbars / tools contain all their attributes explicitly set. If set defaults flag, they contain also all default values from their default item.
 
VArrayFills row cell values in V attribute as array according to VIndex instead of object by column ids. Used only when filling whole parts and for added rows with Changes AddV.
AArrayFills row cell attributes in A attribute as array according to AIndex instead of object by column ids. Used only when filling whole parts and not with Changes and Cookie flags.
NoEDoes not fill attribute E in rows, but fills the results of the formulas to V. Used only when whole parts and not with Changes and Cookie flags.
NoUDoes not fill attribute U in rows. Used only when whole parts and not with Changes and Cookie flags.
NoBDoes not fill attribute B in rows. Used only when whole parts and not with Changes and Cookie flags.
NoLDoes not fill attribute L.
NoEmptyDoes not add rows or columns with only id set. Used only when whole parts and not with Changes and Cookie flags.
DeletedSaves also deleted rows, only with id and Remove:1 attributes. Used only when whole parts and not with Changes and Cookie flags.
NormalizeNormalize attributes in A tag when filling cell attributes in rows. For {partid} and Changes flags
Fills the A always with number references to DefCells instead of attribute objects.
DefIf present, fills row, column, cell, toolbar and tool attributes including values from their D.
flags for layout
ImagesFills all images in Images array.
DefRowsFills all default rows in DefRows object by the default row id.
DefColsFills all default columns in DefCols object by the default column id.
DefCellsFills all default cells in DefCells object by the default cell id.
DefToolbarsFills all default toolbars in DefToolbars object by the default toolbar id.
DefToolsFills all default toolbar cells in DefTools object by the default toolbar cell id.
DefImagesFills all default images in DefImages object by the default image id.
CfgFills configuration attributes in Cfg tag.
FormatFills format attributes in Format tag.
TextFills language texts in Text tag.
ActionsFills actions in Actions tag.
StylesFills special style attributes in Styles tag.
ColorsFills all rgb colors in Colors tag.
BordersFills all border widths in Borders tag.
CellBordersFills all cell borders in CellBorders tag.
IconsFills all icons in Icons tag.
CursorsFills all cursors in Cursors tag.
SvgDefsFills custom svgdefs for icons in SvgDefs tag.
FontFills actual font attributes in Font tag.
RowPartsFills all row parts in RowParts array. Always fills all row parts, regardless the defaults flag.
ColPartsFills all column parts in ColParts array. Always fills all column parts, regardless the defaults flag.
DialogsFills all dialogs in Dialogs object by the dialog id.
MessagesFills all messages in Messages object by the message id.
 
AllDefFills all defaults (shortcut for flags DefRows, DefCols, DefCells, DefToolbars, DefTools, DefImages).
AllFills the whole grid data (shortcut for all data flags except Changes and Cookie)
 
DefaultsIf present, fills all data also from default data in Defaults.js / Styles.js / Text.js. For all layout flags except RowParts and ColParts.
flags for cookies
CookieFills all actual settings according to the Cookie definition.
CookiesFills all configurations in Cookies.
 
NullIf present, fills also all null values.
DefIf present, fills row, column, cell, toolbar and tool attributes including values from their D.
flags for json
QuoteIf present, quotes all attribute and tag names for compatibility with exact JSON definition.
StringsIf present, quotes also all number values for compatibility with some JSON parsers. It should not be used for data passed back to FastGrid!
LFAdds \n after tags, just for better display of the output JSON.
AddDataIf present, adds FGrid.Data= on the start of the returned string.
AddBomIf present, adds UTF8 BOM on the start of the returned string.
other flags
PrintFills Print settings in Cfg tag, to be set to PDF printing.
SelectedFills SelectedRows and SelectedCols in Cfg tag.
Grid method void

AcceptChanges

( )
Accepts all pending changes. Clears all O attributes and removes deleted rows and columns.
Grid method void

HasChanges

( )
Returns true if grid has some pending changes according to the RowChanges / ColChanges and CellChanges.
Cfg int

CheckChanges

[2] GetCfgAttr SetCfgAttr
If the changes are checked before reload or to enable Save icon.
0 - The changes are not checked, the grid is always marked as changed, the HasChanges always returns true.
1 - The grid is marked changed after the first change and the flag is removed only by AcceptChanges.
2 - The grid is marked changed after any change and the flag is removed whenever the grid returns to original state or by AcceptChanges. It can be slow for large grids, so MaxCheckChanges is appllied.
Cfg int

MaxCheckChanges

[100000] GetCfgAttr SetCfgAttr
When count of rows in the grid exceeds this value, the CheckChanges is switched from 2 to 1. To speed up checking changes.

Saving changes to server

The changes or partial or whole grid data can be got by JavaScript API method GetData.
Or they can be sent to server by AJAX using method or action Save.
Cfg string / Source

SaveUrl

[ ] / [ { Export:1 } ] GetCfgAttr SetCfgAttr
An url to upload changes or full changed data to server. What will be uploades is controlled by SaveFlags.
It can be set to string as direct url or to object as Source, with attributes Url, Data, Add, Param, Header, Sync, User, Pass, Safe, Encode, Debug. If not set Method, it is used as AJAX "post".
Data are uploaded in the POST parameter named "Data". It can be changed by SaveParamName.
The server response must not be empty! The simplest successful response is "{}" or "{IO:{Result:0}}".
If set to {Debug:2}, it shows the saved data without uploading.
If set to {Export:1}, it exports full data by action Export instead of uploading. It is set in Sheet by default.
To avoid ASP.NET validation of < and & in the request data, set Encode = 1 or Cfg SaveEncode = 1.
Cfg string

SaveFlags

["Changed,State,Quote"] GetCfgAttr SetCfgAttr
Used only for SaveFormat = json.
Specifies what changes or data will be sent to server on save. The same options as flags in GetData.
Cfg string

SaveFormat

["json"] / ["xlsx"] GetCfgAttr SetCfgAttr
Format of uploaded data. It can be set to json or xlsx.
If set to xlsx, it ignores SaveFlags and uploads the whole grid in xlsx file.
Cfg string[]

SaveIdCols

["id"] GetCfgAttr SetCfgAttr
Uses values of these column cells or row attributes instead of row id when saving changes. Fills them in the uploaded attributes id, Parent, Next and Prev.
Used only for Changes / Changed SaveFlags. Uploads original cell values since last save, not changed cell values.
Separates the values by SaveIdSeparator - the values must not contain it.
For example SaveIdCols="A,D,id" uploads the id as value of column "A" and attributes row.D and row.id. If in the grid are columns "D" or "id", they are used instead of attributes.
Cfg string[]

SaveIdSeparator

["\u007F"] GetCfgAttr SetCfgAttr
Separates the individual ids if used SaveIdCols and / or ParentId in SaveFlags.
Cfg string

SaveParamName

["Data"] GetCfgAttr SetCfgAttr
Name of the POST parameter where to upload the data.
Cfg string

UrlBase

GetCfgAttr SetCfgAttr
String added before all custom relative urls. It should end by slash '/'.
It is also generated from actual url when Save data by "Print" option.
Cfg string / int

SaveGrids

[0] / [1] GetCfgAttr SetCfgAttr
If set to 0, it saves only this grid.
If set to 1, it saves all sheets together according to their NoSave attribute.
If set to string as comma separated list of grid ids, saves these grids together, regardless on their NoSave attribute.
Cfg string

SaveCfgAttrs

[ ] / [...] GetCfgAttr SetCfgAttr
Comma separated list of Cfg attributes their change in Settings menu sets GridChanged and the grid is marked as changed.
Cfg bool

GridChanged

[0] GetCfgAttr SetCfgAttr
If set, the grid is marked as changed and the HasChanges() returns true.
Cfg int / string

SaveMessage

[1] GetCfgAttr SetCfgAttr
If shows message on sucessful save. 0 - no, 1 - for short time, 2 - for longer time, 3 - with OK button, string - this message, with OK button.
Cfg int

NoSave

[0] GetCfgAttr SetCfgAttr
If the grid saving is restricted. Only for SaveGrids = 1.
-2 - grid is saved always and not shown in sheets in Save menu, -1 - grid is saved always, 0 - grid is saved only if it is not Hidden, 1 - grid is not saved, 2 - grid is not saved and not shown in sheets in Save menu.
Row, Col, Toolbar bits

NoSave

GetAttr SetAttr
1. bit &1 - if set, the row / column / toolbar will be not uploaded in save response.
2. bit &2 - if set, the row / column / toolbar is not used as Prev / Next / Parent in save response.
Source int

Debug

Source attribute special to SaveUrl. If set to 1 it prints to debug the saved response. If set to 2, the SaveUrl is used only for debugging the response.
IO int

Result

[0]
It can be filled in save response JSON data in IO tag.
Result of the saving. If set negative, the changes are not accepted and it shows error message.
IO string

Message

Message shown in grid after save as Ok message for Result>=0 or Error message for Result<0.
IO string

MessageD

Message default for IO Message.
IO bool

Reload

[0]
If set, it fully reloads the grid from server.
IO bool

Accept

[1]
If set to 0, does not accept changes done by adding the response data to grid.
Actions

Save

(int target = 0, bits validate = 0) OnClickSave
Saves changes to server.
If set validate&1, it checks if the grid has some changes and fails if no changes are pending.
If set validate&2, calls also action Validate and fails if the Validate fails.
Grid method bool

Save

(bits validate = 0)
Saves changes to server.
If set validate&1, it checks if the grid has some changes and fails if no changes are pending.
If set validate&2, calls also action Validate and fails if the Validate fails.
API event bool

OnSave

(Grid grid, Source source, Grid[] grids)
Called before the grid changes are saved to server, before the uploading starts.
source is the SaveUrl, it is always object and it is copy of the original object and can be changed to modify the communication.
Grids is array of all grids being saved.
Return true to suppress the save action.
API event string

OnSaveChanged

(Grid grid, Row / Col item, string data)
Called for every saved row or column when saving changed rows / columns (flags Changed or Changes).
data is JSON string that is saved for given row / column. It does not end by comma, e.g. "{id:1,Add:1".
Add or modify the data and return it from the event handler, e.g. return data+",Value:\""+r.Value.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+"\"";
Use double quotes to quote the values, remember to replace the " and \ characters.
API event object

OnSaveXlsxError

(Grid grid, Source source, Grid[] grids)
Called when failed generating xlsx to save to server by SaveFormat = xlsx
No communication with server done.
Return true to not display error message.
API event object

OnSaveError

(Grid grid, Source source, int code, string message, Grid[] grids)
Called when loading of server response failed.
Returning null or false will end saving, will not accept the changes and show error message.
Returning true will end saving, will not accept the changes, but will not show error message.
Returning JSON object will continue with it as a response from the errorneous data source and will accept changes and show no error message.
source is the SaveUrl, it is always object and it is copy of the original object, but has no sense to change it.
Grids is array of all saved grids.
The code and message are the same as OnLoadError.
API event any

OnSaveAccept

(Grid grid, Source source, object data, Grid[] grids)
Called after received sucessfully the server response, before the returned JSON data are added to grid and changes are accepted.
source is the SaveUrl, it is always object and it is copy of the original object, but has no sense to change it.
Grids is array of all saved grids.
Return true to not add the data and not accept the changes.
Return object as new data to add to grid instead of the data.
API event bool

OnSaved

(Grid grid, Source source, Grid[] grids)
Called after the grid changes are saved to server and sucessful response received and all the changes are accepted by AcceptChanges.
source is the SaveUrl, it is always object and it is copy of the original object, but has no sense to change it.
Grids is array of all saved grids.
Return true to not show SaveMessage.

Mark changes

Cfg bits

CellChanges

[7] GetCfgAttr SetCfgAttr
Cell changes that are stored and can be marked or uploaded. &1 - values, &2 - attributes, &4 - row & column span.
Cfg int

MarkCells

[9] / [1] GetCfgAttr SetCfgAttr
How marks the changed cells and the cells with editable formula / error and read only / editable cells.
0 - no,
1 - 8 - Mark icon in given corner - 1 - at top left, to right, 2 - at top left, to down, 3 - at top right, to left, 4 - at top right, to down, 5 - at bottom right, to left, 6 - at bottom right, to up, 7 - at bottom left, to right, 8 - at bottom left, to up,
9 - background color, 10 - not used,
11 - 18 - background color and Mark icon in given corner (like 1 - 8).
Cfg bits

MarkCellsFlags

[29 = 1+4+8+16] / [56 = 8+16+32] GetCfgAttr SetCfgAttr
What is marked in cells by MarkCells.
&1 - cell changes defined by CellChanges, &2 - editable cells, &4 - read only cells, &8 - cell with editable formula, &16 - cell with error in editable formula, &32 - editable cells in not editable grid or not editable cells in editable grid
Cfg bits

RowChanges

[255 = 1+2+4+24+32+64+128] / [481 = 1+32+64+128+256+1024] GetCfgAttr SetCfgAttr
Row changes that are stored and can be marked or uploaded.
&1 - cell changes, marks row as changed if any of its cell changed according to the CellChanges. If not set, the changed cells are still marked and can be uploaded.
&2 - added,
&4 - deleted - if not set, the deleted rows are removed and cannot be undeleted or shown,
&24 - moved (8 - only to another parent (as 24 in O), 16 - also inside (as 16 in O) and with parent (as 8 in O), 24 - every move, does not differ, (always as 24 in O and cannot use ParentId in SaveFlags),
&32 - resized,
&64 - shown / hidden,
&128 - row attributes, marks row as changed if any its style attribute (e.g. Color or TextSize) changed,
&256 - expanded / collapsed children,
&512 - selected / unselected.
&1024 - count of added / removed rows, for checking if the grid has some changes. If not set &2 and &4.
Cfg int

MarkRows

[9] / [0] GetCfgAttr SetCfgAttr
How marks the changed rows by RowChanges.
0 - no,
1 - 8 - Mark icon in given corner - 1 - at top left, to right, 2 - at top left, to down, 3 - at top right, to left, 4 - at top right, to down, 5 - at bottom right, to left, 6 - at bottom right, to up, 7 - at bottom left, to right, 8 - at bottom left, to up,
9 - background color, 10 - not used,
11 - 18 - background color and Mark icon in given corner (like 1 - 8).
Cfg string

MarkRowsCol

["Index"] GetCfgAttr SetCfgAttr
Column id where will be shown mark icons for MarkRows.
Cfg bits

ColChanges

[0] / [481 = 1+32+64+128+256+1024] GetCfgAttr SetCfgAttr
Column changes that are stored and can be marked or uploaded. By default no column changes are stored.
&1 - cell changes, marks columns as changed if any of its cell changed according to the CellChanges. If not set, the changed cells are still marked and can be uploaded.
&2 - added,
&4 - deleted - if not set, the deleted columns are removed and cannot be undeleted or shown,
&24 - moved (8 - only to another parent (as 24 in O), 16 - also inside (as 16 in O) and with parent (as 8 in O), 24 - every move, does not differ, (always as 24 in O),
&32 - resized,
&64 - shown / hidden,
&128 - column attributes, marks column as changed if any its style attribute (e.g. Color or TextSize) changed,
&256 - expanded / collapsed children,
&512 - selected / unselected.
&1024 - count of added / removed columns, for checking if the grid has some changes. If not set &2 and &4.
Cfg int

MarkCols

[9] / [0] GetCfgAttr SetCfgAttr
How marks the changed columns by ColChanges.
0 - no,
1 - 8 - Mark icon in given corner - 1 - at top left, to right, 2 - at top left, to down, 3 - at top right, to left, 4 - at top right, to down, 5 - at bottom right, to left, 6 - at bottom right, to up, 7 - at bottom left, to right, 8 - at bottom left, to up,
9 - background color, 10 - not used,
11 - 18 - background color and Mark icon in given corner (like 1 - 8).
Cfg string

MarkColsRow

["Header"] GetCfgAttr SetCfgAttr
Row id where will be shown mark icons for MarkCols.
Cfg bits

ToolChanges

[0] GetCfgAttr SetCfgAttr
Toolbar cell changes that are stored and can be marked or uploaded. By default no toolbar changes are stored.
&1 - values, &2 - attributes.
Cfg int

MarkTools

[9] GetCfgAttr SetCfgAttr
How marks the changed toolbar cells and read only / editable cells.
0 - no,
1 - 8 - Mark icon in given corner - 1 - at top left, to right, 2 - at top left, to down, 3 - at top right, to left, 4 - at top right, to down, 5 - at bottom right, to left, 6 - at bottom right, to up, 7 - at bottom left, to right, 8 - at bottom left, to up,
9 - background color, 10 - not used,
11 - 18 - background color and Mark icon in given corner (like 1 - 8).
Cfg bits

MarkToolsFlags

[1] GetCfgAttr SetCfgAttr
What is marked in toolbar cells by MarkTools.
&1 - toolbar cell changes defined by ToolChanges, &2 - editable toolbar cells, &4 - read only toolbar cells.
Cell, Tool bool

NoChanges

GetAttr SetAttr
If set, the changes in the cell (value, editable formula, attributes) are not maintained.

Loading children on expand parent

Row int

Children

GetAttr SetAttr
If set, the row downloads its child rows from ChildrenUrl on its expand.
This number is shown on the Collapse icon as number of row's children when set ExpandDigits.
Ignored, if the row is expanded as Collapsed = 0!
If the row has already some children, the loaded children are added to them.
It is automatically set negative during loading the children.
It is automatically set to 0 after loaded the children, except if set ChildrenReload.
Row int

ChildrenL

[1] GetAttr SetAttr
Deepness of the nested levels by Children attribute. By default it is 1 for 1 nested levels.
Cfg string / Source

ChildrenUrl

GetCfgAttr SetCfgAttr
An url to load child rows from server when expanding row with Children attribute.
It can be set to string as direct url or to object as Source, with attributes Url, Data, Add, Param, Header, Sync, User, Pass, Safe, Debug. If not set Method, it is used as AJAX "get".
The url string can contain keyword *Row to be replaced by the row id that is being expanded.
The ids of rows being expanded are uploaded in parameter named Rows, comma separated. It can be changed by ChildrenParamName.
The loading is asynchronous, the row expand buttons shows wait icon during loading.
The server response should contain new rows to be added to grid, usually with Parent attribute to be added to the row being expanded.
For example: FGrid.Data = { Body:[ { id:71, Parent:7, V: { A:"Added 7-1" } }, { id:72, Parent:7, V: { A:"Added 7-2" } }, { id:73, Parent:7, V: { A:"Added 7-3" } } ] }
Row string

ChildrenUrl

GetAttr SetAttr
An url to load child rows from server when expanding this row with Children attribute, used instead of Cfg ChildrenUrl.
Cfg bool

ChildrenReload

[0] GetCfgAttr SetCfgAttr
If set, the ChildrenUrl is loaded on every expand. If not set, the children are loaded only on the first expand.
Row bool

ChildrenReload

GetAttr SetAttr
If set, the ChildrenUrl is loaded on every expand of this row. If not set, the children are loaded only on the first expand, used instead of Cfg ChildrenReload
Cfg string

ChildrenParamName

["Rows"] GetCfgAttr SetCfgAttr
Parameter name where to include ids of the rows that are being expand. The ids are comma separated.
Cfg bool

PrintLoadChildren

[0] GetCfgAttr SetCfgAttr
If set, loads all children of rows with Children attribute on print, if PrintRowsType contains "Collapsed".
Cfg bool

ExportLoadChildren

[0] GetCfgAttr SetCfgAttr
If set, loads all children of rows with Children attribute on export, if ExportRowsType contains "Collapsed".
Cfg string

UrlBase

GetCfgAttr SetCfgAttr
String added before all custom relative urls. It should end by slash '/'.
It is also generated from actual url when Save data by "Print" option.
Grid method void

LoadChildren

(Row / Row[] rows, function func)
Starts loading children from ChildrenUrl of the parent rows.
func is called after finish. If the func returns true, the Paint is not done.
Grid method bool

LoadAllChildren

(function func)
Starts loading all children from ChildrenUrl for all rows in grid.
func is called after finish. If the func returns true, the Paint is not done.
If there is no parent row to load its children, returns false and does not call func.
Returns true, if the loading started.
API event bool

OnLoadChildren

(Grid grid, Row[] rows, Source source)
Called before child rows of parent rows are loaded from source.
source is copy of the ChildrenUrl and can be modified in this event handler. It can be also array of sources if the rows contain more parents.
Return true to not load the children.
API event void

OnLoadedChildren

(Grid grid, Row[] rows)
Called after all the children of the parent rows are loaded, before paint.

Short format

In input data it is possible to code the data as short as possible in short format.
The row cell values and cell attributes can be coded into Unicode strings in U and B attributes using WriteValue() function.

The whole RowPart or ColPart can be coded into Unicode strings using short format by WriteValue() function, e.g. { Cfg:{...}, Body:"...", Cols:"..." }
In the short format are also permitted variable length strings (WriteValue ucode & 0x80).
If the part has not set Par, the first char(s) in the part string is number or name of Par, coded by WriteValue ucode = ParUCode.
The next chars are values according to the Par definition, coded by WriteValue.
The number of values in the RowPart / ColPart string is (0 or 1) + Par length * (row/col) count.
Grid any

Par

Array of object defining attributes for short format.
The Par definition can be set as: a) string as shortcut for Par:"..." => Par:["..."], b) array as Par:[[],[],[],...], c) object as Par:{Name1:[],Name2:[],Name3:[],...}.
The short format refers the individual Par items by the array index or the object attribute name.

The individual Par item can be first character separated string or an array as: "|attr1|ucode1|attr2|ucode2|attr3|ucode3|..." or ["attr1",ucode1,"attr2",ucode2,"attr3",ucode3,...].
attr is the row / column attribute name, the ucode is a number as value format used by WriteValue.
Or the ucode can be an object with possible attributes: UCode (the number format, required), Texts as the first texts, UTexts as the ucode2 results or second texts.
For example: [["id",0x11,"L",0x1,"S",0x1,"U",0x200C],["id",{UCode:0xC4,Texts:"|aaa|bbb|ccc|ddd|eee"},"UCode",0x1,"Width",0x1,"UIndex",0x11]] - the first par has name/index 0, the second part 1.
If there are defined more Par tags and some item has the same index / name as already existing item, the old item is replaced by the new item.
Part string[]

Par

Comma separated string list or array of Par ids that will be periodically used for loaded rows (columns).
For example Body_Cfg: { Par: "P1,P2,P3" }, the first row is coded by par P1, the second by par P2, the third by par P3, the fourth by P1, the fifth by P2, etc.
If the part does not have set the Par attribute, the first char(s) of every row (column) definition is id of the Par, coded as WriteValue ucode = 0x81.
Cfg int

ParUCode

[0x41]
ucode used for encoding Par number or name.