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

Import files to grid

FastGrid documentation

Files to FastGrid can be imported by dropping them to the grid or by opening them by clicking to Import icon on toolbar.
It is possible to import xlsx, csv or json files.
If set Book, the xlsx or json is imported as all new sheets, the csv is imported as one new sheet.
If not set Book, the active sheet data in xlsx or json are added to existing grid, the csv data are added to existing grid. It does not modify columns.
Cfg bits

ImportAction

[0] / [7] GetCfgAttr SetCfgAttr
How files can be imported to the grid:
1. bit &1 - If files can be imported by choosing them in system file dialog.
2. bit &2 - If files can be imported by dropping them to grid.
3. bit &4 - If more files can be imported at once.
Cfg int

DropFiles

[0] / [1] GetCfgAttr
If files can be dropped to the grid.
If set to 1 or -1, dropping of any unsupported file to the grid will cancel default browser action for this file drop.
It must be set to 1 to permit dropping xlsx files for import and dropping image files to cells.
Cfg string[]

ImportExt

["xlsx,csv,json"] GetCfgAttr SetCfgAttr
List of file extensions that can be imported to the grid. It can be comma separated string or array.
It can be also an object with name:value to specify extensions and their meaning like ImportExt:{xlsx:"xlsx",xlsm:"xlsx",xltx:"xlsx",json:"json",js:"json",csv:"csv"}.
There is built-in support for importing standard xlsx and csv formats and proprietar FastGrid json format.
Cfg int

ImportAdd

[0] GetCfgAttr SetCfgAttr
If the imported file(s) will be added to existing data or the existing data will be discarded.
0 - It shows message with buttons Add/Discard/Cancel.
1 - It adds the file(s) to the existing data.
2 - It discards the existing data and opens the file(s).
5 - It shows message with Add/Cancel buttons.
6 - It shows message with Discard/Cancel buttons.
Cfg bool

ImportAttrs

[0] GetCfgAttr SetCfgAttr
What imports from the xlsx or json to existing grid (no Book is set) and ImportAdd adds the data or ImportReplace is not set.
0 - imports only cell values. If import contains editable formulas, imports only their results.
1 - imports also cell attributes and editable formulas.
If set Book, it always imports the data fully including attributes and full layout.
Cfg bool

ImportJavaScript

[0] GetCfgAttr SetCfgAttr
If not set, removes from the imported json all JavaScript code, removes all event handlers, JavaScript formulas and JavaScript functions.
Cfg bool

ImportReplace

[0] GetCfgAttr SetCfgAttr
If set and no Book is set, the imported data replaces also columns.
Cfg bool

ImportSafe

[1] GetCfgAttr SetCfgAttr
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.
Cfg string

ImportBody

["Body"] GetCfgAttr SetCfgAttr
id of the part, where the data are added, if no Book is set.
For csv the CsvBody is preferred.
Cfg string

ImportEncoding

["UTF-8"] GetCfgAttr SetCfgAttr
Encoding of the imported text files like json and csv. The value is ISO encoding like "iso-8859-1" or "UTF-8".
Cfg int

ImportPassword

[1] GetCfgAttr SetCfgAttr
How the locked sheets and workbooks with password will be imported.
0 - password will be removed and the sheet can be unlocked.
1 - password will be stored and the saved sheet will be locked with this password and the changed locks if any. Sheet can be unlocked in grid.
2 - password will be stored and the saved sheet will be locked with this password and the same locks. Sheet can be unlocked in grid.
3 - password will be stored and the saved sheet will be locked with this password and the same locks. Sheet cannot be unlocked.
Actions

Import

(int target = 0) OnClickImport
Opens system dialog to choose file(s) for import. Available only if set ImportAction&1.
API event bool

OnImportData

(Grid grid, File[] files, int type)
Called before given files are imported to the grid.
type is 1 for adding files, 2 for discard existing data.
Return true to cancel the import.
API event bool

OnImportingData

(Grid grid, any[] data, File[] files, object[] errors, int type)
Called after given files were read and before the read data data are imported to the grid.
type is 1 for adding files, 2 for discard existing data.
errors contains array of errors if any, see OnImportDataError.
Return true to not do the default import.
API event void

OnImportedData

(Grid grid, File[] files, object[] errors)
Called after given files have been imported to the grid. The changes are already painted.
errors is array of errors - the other files that were imported but failed, see OnImportDataError. On full success the array has zero length.
API event bool

OnImportDataError

(Grid grid, File[] files, object[] errors)
Called after given files have been imported to the grid and / or there were some errors. The changes are already painted.
files can have zero length if no file was successfully imported.
errors contains array of errors - the files that failed to import. The structure is [[code1,filename1,errortext1,file1,error1],[code2,filename2,errortext2,file2,error2],...].
Where code is data error code, here can be -8 - Invalid xlsx data or -9 - Error loading imported file, filename is name of the file, errortext is error message, file is File object, error is full error object or exception.
It is called before OnImportedData if both events are called.
Return true to not display default error message.
Grid method void

MergeBooks

(Grid grid)
Merges grid and all other sheets in its Book into actual grid and its Book.
Adds the new sheet to the end of actual grid Book.
If the grid has no Book, adds it as single sheet. If actual grid has no Book, adds it in begining of grid Book.
If none of the grids has Book, it creates new Book with these two sheets.