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

Toolbar

FastGrid documentation

Toolbar

Toolbar string / int

id

GetAttr
Toolbar identification unique in the whole, among all toolbars.
If not set, it is set as ToolbarIdPrefix + ToolbarId++.
It can be used by GetToolbar to get the Toolbar object for API usage.
Cfg string

ToolbarIdPrefix

["Toolbar"]
Prefix added before auto generated Toolbar id.
Cfg int

ToolbarId

[1]
Starting number for auto generating Toolbar id.
Toolbar string

D

["Toolbar"] GetD SetD
Default toolbar to read all unset attributes from.
See predefined default toolbars.
Cfg int

HidingToolbars

[0]
If the toolbars can be hidden.
If set to 2 it also shows all hidden toolbars that can be shown.
If set to 3 it also shows / hides the toolbars on single click.
It is automatically set by SetDraggingToolbars.
Toolbar bool

Hidden

IsHidden HideToolbar
If set, the toolbar is not displayed at all.
Toolbar bool

NoHide

[0] GetAttr SetAttr
If set, the toolbar cell cannot be hidden or shown.
Toolbar string

Name

GetAttr SetAttr
Toolbar name that is shown as in menus and messages. If not set, toolbar id is used.
Grid method Toolbar

GetToolbar

(string id)
Returns toolbar according to its id.
Grid method Toolbar

GetToolbar

(Tool cell)
Returns toolbar the cell belongs to.
Grid method bool

IsToolbar

(object toolbar)
Returns true if the toolbar is Toolbar object.
Grid method string

GetPart

(object obj)
Returns id of part that the row, column, toolbar or toolbar cell belongs to.
Grid method Grid

GetGrid

(object obj)
Returns grid that the row, column, toolbar or toolbar cell belongs to.
API event string / int

OnGenerateId

(Grid grid, object item, string / int id, int type)
Called when generating id for any row, column, toolbar or toolbar cell in grid.
It is not called if the item has set its unique id.
type is item kind: 0 - row, 1 - column, 2 - group row, 3 - goup column, 4 - toolbar, 5 - toolbar cell.
API event string

OnGetName

(Grid grid, Row / Col / Toolbar item)
Called to get row / column / toolbar Name.
Grid method Toolbar

AddToolbar

(any src = null, Toolbar next = null, bool copy = 0, bool all = 0)
Adds or moves (copy = 0) or copies (copy = 1) toolbar.
It moves or copies also from another grid if the src is toolbar in another grid.
If set all, it moves / copies also all next toolbars with Pos >= 3 together.

src specifies the toolbar that is added / copied / moved.
It can be Toolbar object as existing toolbar to copy / move.
Or it can be an object to add new toolbar.
Or it can be string to add new toolbar with given D and / or id.
Or it can be null to add new empty toolbar.

The new toolbar is added left to the next toolbar.
Or the next can be part id to add the toolbar to the end of the part.
If next is null, the cell is added to the end of first Toolbars part.

Returns added / moved / copied toolbar. Or returns null if nothing was modified.
Grid method bool

RemoveToolbar

(Toolbar toolbar)
Removes given toolbar from its part.
Returns true for success and false for error.
API event bool

OnAddToolbar

(Grid grid, Toolbar toolbar, Toolbar next, Toolbar copy, Toolbar[] all)
Called before the toolbar added / moved / copied left to the next toolbar. Called from AddToolbar method.
copy is set to source toolbar if it is copied.
all is array of all source toolbars that will be added / moved / copied. It should not be modified.
Return true to cancel the action. Or modify the toolbar object and return false.
API event void

OnAddedToolbar

(Grid grid, Toolbar toolbar, Toolbar next, Toolbar copy, Toolbar[] all)
Called after the toolbar added / moved / copied left to the next toolbar. Called from AddToolbar method.
API event bool

OnRemoveToolbar

(Grid grid, Toolbar toolbar)
Called before the toolbar removed from its part. Called from RemoveToolbar method.
It is not called when moving the toolbar to another part or grid.
Return true to cancel the action.
API event void

OnRemovedToolbar

(Grid grid, Toolbar toolbar)
Called after the toolbar removed from its toolbar. Called from RemoveToolbar method.
It is not called when moving the toolbar to another part or grid.
Actions

HideToolbar

(int target = 0) OnCtrlClickDragToolbar
Hides actual toolbar.
Grid method bool

HideToolbar

(Toolbar toolbar, bool hide = null)
Hides or shows the toolbar. hide = null - change visibility, 1 - show, 0 - hide.
Returns true for change, false without change and null for incorrect toolbar.
API event bool

OnHideToolbar

(Grid grid, Toolbar toolbar, bool hide, bool test)
Called before the toolbar is hidden / shown. Called from HideToolbar method.
hide = 0 - show, 1 - hide.
test is true if just testing possibility of showing / hiding, e.g. to display the action in popup menu.
Return true to cancel the action.

Cells

Toolbar cells are Tool objects and have similar attributes like standard Row cells.
The Toolbar cell attributes are defined directly in the Tool object.
Toolbar Tool[] / string[]

Cells

Full definition of the toolbar cells.
It is an array of objects as Tool items.
The item can be also string to be used as id and if exists default, also as D - "XXX" => { id:"XXX", D:"XXX" }.
The Cells Tool defined as objects support also attributes Next, Prev, Remove, Add to redefine existing cells or place the cell to specific position.
If the first item is object {Clear:1}, it clears all previously defined cells in this toolbar.
If the first item is empty string or null, it places all the next cells like with Next = "".
If defined toolbar with already existing id, the Cells are merged with the previous Toolbar Cells, except if defined Add attribute in the Toolbar.
If defined two cells with the same id in the same Cells array, the second id is changed to be unique.
Tool string / int

id

GetAttr
Cell identification unique in its Toolbar.
If not set or already exists in the toolbar, it is set as ToolIdPrefix + ToolId++.
It can be used by GetTool to get the Tool object for API usage.
Cfg string

ToolIdPrefix

["Tool"]
Prefix added before auto generated Tool id.
Cfg int

ToolId

[1]
Starting number for auto generating Tool id.
Tool string

D

["Icon" / "Cell"] GetD SetD
Default toolbar cell to read all unset attributes from.
If not set, it is set to "Icon" if Type is not explicitly set, otherwise it is set to "Cell".
See predefined default toolbar cells.
Cfg int

HidingTools

[0]
If the toolbar cells can be hidden or shown.
If set to 2 it also shows all hidden toolbar cells that can be shown.
If set to 3 it also shows / hides the toolbar cells on single click instead of running action for the cell.
It is automatically set by SwitchDraggingToolbars.
Tool bool

Hidden

GetAttr HideTool
If set, the cell is not displayed at all.
It is not read from the toolbar row!
Tool bool

NoHide

[0] GetAttr SetAttr
If set, the toolbar cell cannot be hidden or shown.
It is not read from the toolbar row!
?? Tool string

Text

GetAttr SetAttr
Text displayed on cell. If not set, Value is shown. If set neither Value, id is shown.
Useful when the cell Value is used for other purpose, e.g. on Bool type.
It can contain HTML code. Using incorrect HTML code can break down the grid completely!
Using many cells with HTML code remarkably slows down paint!
?? Tool string

Label

GetAttr SetAttr
Left side label text for the cell.
It can contain HTML code. Using incorrect HTML code can break down the grid completely!
Using many labels with HTML code remarkably slows down paint!
The Label can have set the text style attributes: LabelTextColor, LabelTextLine, LabelTextLineColor, LabelTextShadow, LabelTextShadowColor, LabelTextStyle, LabelTextFont, LabelTextSize.
And also attributes LabelVertAlign, LabelLink and LabelTranslate.
Using the text style attributes in many labels can slow down paint!
?? Tool string

LabelRight

GetAttr SetAttr
Right side label text for the cell.
It can contain HTML code. Using incorrect HTML code can break down the grid completely!
Using many labels with HTML code remarkably slows down paint!
The LabelRight can have set the text style attributes: LabelTextColor, LabelTextLine, LabelTextLineColor, LabelTextShadow, LabelTextShadowColor, LabelTextStyle, LabelTextFont, LabelTextSize.
And also attributes LabelVertAlign, LabelLink and LabelTranslate.
Using the text style attributes in many labels can slow down paint!
Tool bool

More

If set in default toolbar cell, this default tool can be defined more times in one toolbar Cells by string, e.g. for Separator: Cells:["Add","Separator","Delete","Separator","Move"].
If toolbar is saved to cookies, ignores Next in Cookie Tools.
Grid method Tool

GetTool

(any toolbar, string id)
Returns toolbar cell according to its id.
toolbar can be Toolbar object or string as toolbar id.
Grid method Tool

GetTool

(string id)
Returns first toolbar cell that's id is id. Iterates all toolbars.
Grid method bool

IsTool

(object tool)
Returns true if the tool is Tool object as toolbar cell.
Actions

HideTool

(int target = 0) OnCtrlClickTool
Hides actual toolbar cell.
Grid method bool

HideTool

(Tool cell, bool hide = null)
Hides or shows the toolbar cell. hide = null - change visibility, 1 - show, 0 - hide.
Returns true for change, false without change and null for incorrect cell.
API event bool

OnHideTool

(Grid grid, Tool cell, bool hide, bool test)
Called before the toolbar cell is hidden / shown. Called from HideTool method.
hide = 0 - show, 1 - hide.
test is true if just testing possibility of showing / hiding, e.g. to display the action in popup menu.
Return true to cancel the action.

Icon

?? Tool string

Icon

GetAttr SetAttr
Icon displayed on the toolbar cell.
The usable icons are defined in Icons tag, default FastGrid icons are defined in Styles.js.
If Icon is not set and Type is also not set (or used D: "Icon"), the Icon is set to cell id.
The Icon is ignored for Bool Type.

External image
The Icon can be set also to url to external image file or included image by "data:".
The relative urls are relative to the main page url, not to FastGrid url.
Size of the external image can be set by IconHeight. If not set, the image is shown on its original size. The external image is shrunk, if the image default or explicit height is higher than the toolbar height.
Using external images can slow down paint!
External images should be used only for development; in production they should be converted to internal images in Icons.
Tool string

IconButton

GetAttr SetAttr
Action button for given Icon. If not set, it is the toolbar cell Button.
To this button events are assigned actions in Actions object or in Tool / Toolbar.
Tool int

IconAlign

GetAttr SetAttr
Icon position: 0 - left to the text, 1 - right to the text.
Tool int

IconWidth

GetAttr SetAttr
Reserved horizontal space for the Icon in pixels. If not set, the space is reserved by Cfg IconWidth.
If the icon is affected by IconZoom, the reserved space is multiplied by the IconZoom.
It neither resizes nor overflows the icon.
Cfg int

IconWidth

[17] GetCfgAttr SetCfgAttr
Predefined reserved horizontal space for of all icons in grid. Affects both cell icons and toolbar icons.
It neither resizes nor overflows the icon.
Tool int

IconHeight

GetAttr SetAttr
For internal Icon (defined in Icons), it specifies expected icon height in pixels for vertical alignment by VertAlign / IconVertAlign.
If set to -1, it is set to the whole row height. If not set, the Cfg IconHeight is used.
It neither resizes nor overflows the internal icons. It does not affect the toolbar height.

For external image set by url in the Icon, it specifies the exact height of the image - the image is resized to the IconHeight.
If not set, the external image is shown in its implicit size, but for vertical alignment is used the Cfg IconHeight.
If the icon is affected by IconZoom, the icon is resized by the IconZoom ratio.
The external image is shrunk, if the image default or explicit height is higher than the toolbar height.
Cfg int

IconHeight

[17] GetCfgAttr SetCfgAttr
Predefined expected icon height in pixels for vertical alignment by VertAlign / IconVertAlign.
It neither resizes nor overflows the icon. It does not affect the toolbar height.
Cfg int

IconPopupWidth

[9] GetCfgAttr SetCfgAttr
Predefined reserved horizontal space for of Popup icons in toolbar cells.
Cfg number

IconZoom

[1.25] GetCfgAttr SetCfgAttr
Multiplies toolbar icons. To have icons on toolbar bigger than in grid cells.
It should be set with ToolbarHeight. For example IconZoom = 1.75 should increase default ToolbarHeight 30 to 42 ( = 30 / 1.25 * 1.75).
Cfg bool

TextIconZoom

[1] GetCfgAttr SetCfgAttr
If the IconZoom is applied also for icons in cells with side text or with Width set. And is applied also for toolbar text vertical padding.
Tool bool

IconZoom

GetAttr SetAttr
If the icon is scaled according to the IconZoom. If not set, it is 1 or according to TextIconZoom.
Tool int

Popup

GetAttr SetAttr
If set to 1, shows popup icon right to the Icon. On click shows List / ListMenu.
If set to 2, it does not show the popup icon, but still behaves like popup icon and on click shows List / ListMenu.

Height

Toolbar int

Height

[30] GetAttr SetAttr
Height of the toolbar in pixels. It includes PaddingTop and PaddingBottom.
If set to 0, it calculates the height according to the cell content plus vertical padding.
It should be changed accordignly with IconZoom.
Toolbar int

MinHeight

[1] GetAttr SetAttr
Minimal height in pixels of the toolbar for resizing.
Toolbar int

MaxHeight

[200] GetAttr SetAttr
Maximal height in pixels of the toolbar when its Height is set to 0 and for resizing.
Cfg int

ToolbarHeight

[30] GetCfgAttr SetCfgAttr
Default toolbar height if it has not set Height attribute.
Toolbar int

MarginTop

[0]
Empty space above the toolbar in pixels.
Toolbar int

MarginBottom

[0]
Empty space below the toolbar in pixels.
Toolbar int

PaddingTop

[7] GetAttr SetAttr
Space from the cell top edge to the cell text or Icon in pixels. It is included in Height
Used for VertAlign = 0 (top). Used also partially if the content plus vertical padding is higher than Height.
Toolbar int

PaddingBottom

[5] GetAttr SetAttr
Space from the cell bottom edge to the cell text or Icon in pixels. It is included in Height
Used for cell VertAlign = 1 (bottom). Used also partially if the content plus vertical padding is higher than Height.
Toolbar int

IconPaddingTop

[-5] GetAttr SetAttr
Vertical space between icon top edge and text top edge, in pixels.
It is added to PaddingTop for Icon.
Toolbar int

IconPaddingBottom

[-2] GetAttr SetAttr
Vertical space between icon bottom edge and text bottom edge, in pixels.
It is added to PaddingBottom for Icon.
Cell, Tool int

VertAlign

[2] GetAttr SetAttr
How the cell content (text and icon) is vertically aligned.
0 - align top, 1 - align bottom, 2 - align middle.
Cells are always overflown from bottom.
Tool int

IconVertAlign

GetAttr SetAttr
How the Icon is vertically aligned. If not set, the VertAlign
0 - align top, 1 - align bottom, 2 - align middle.
Tool int

LabelVertAlign

GetAttr SetAttr
How the Label and LabelRight are vertically aligned. If not set, the VertAlign
0 - align top, 1 - align bottom, 2 - align middle.
Tool bits

UseResize

GetAttr SetAttr
1. bit, &1 = 1, dragging bottom edge of the cell will resize the toolbar height.
2. bit, &2 = 2, dragging right edge of the cell will resize the cell width.
3. bit, &4 = 4, dragging the bottom cell edge will resize the cell only if DraggingToolbars>=2 and dragging the right cell edge will resize the cell only if DraggingTools>=1.

Width

Tool int

Width

[0] GetAttr SetAttr
Width of the cell text in pixels. If set to 0 (by default), it is calculated as the text width.
If set Rel and the Width = -1, it never resizes the cell above its text width; if the Width = -2, it never resizes the cell below its text width; other Width values are ignored if set Rel.
Final cell width is calculated as:
Text only: PaddingLeft + Width + PaddingRight.
Text + Icon on the right: PaddingLeft + Width + PaddingText + IconWidth*IconZoom + PaddingRight.
Text + Icon on the left: PaddingLeft + IconWidth*IconZoom + PaddingText + Width + PaddingRight.
Text + CellBorder: PaddingLeft + CellBorderSpace + Width + CellBorderSpace + PaddingRight.
Text + CellBorder + Icon on the right: PaddingLeft + CellBorderSpace + Width + CellBorderSpace + PaddingText + IconWidth*IconZoom + PaddingRight.
Text + CellBorder + Icon on the left: PaddingLeft + IconWidth*IconZoom + PaddingText + CellBorderSpace + Width + CellBorderSpace + PaddingRight.
Icon only or with CellBorder: PaddingLeft + IconWidth*IconZoom + PaddingRight.
Tool int

MinWidth

[0] GetAttr SetAttr
Minimal width in pixels used for Rel cell or if the Width = 0 or for resizing.
Tool int

MaxWidth

[0] GetAttr SetAttr
Maximal width in pixels for Rel cell or if the Width = 0 or for resizing.
Tool number

Rel

[0] GetAttr SetAttr
If set, maximizes the cell width to fill the whole space for toolbar - to be no empty space right to the toolbar.
If more cells on one line have Rel attribute set, their width is increased in their Rel values ratio.
When there can be more toolbars on one line, their Rel cells are first set to MinWidth and after placing all toolbars, the Rel cells are maximized.
Toolbar bits

Narrow

[31] GetAttr SetAttr
What can be shrunk if the toolbar with Rel cells is wider than grid.
1. bit &1 - MinWidth is set to 1 pixel.
2. bit &2 - PaddingLeft and PaddingRight is set to 0 pixels.
3. bit &4 - if set CellBorder, its Left and Right is set to 0 pixels.
4. bit &8 - Icon is set to "".
5. bit &16 - The text is displayed as html to not be overflowed to whole characters.
6. bit &32 - Sets Rel attribute to cell without it.
Toolbar int

MarginLeft

[0]
Empty space left to the toolbar in pixels.
Toolbar int

MarginRight

[0]
Empty space right to the toolbar in pixels.
Tool int

MarginLeft

[0] GetAttr SetAttr
Empty space between the cell and previous cell in pixels. It is added before left Label if any. Multiplied by IconZoom
It is not read from the Toolbar row.
Tool int

MarginRight

[0] GetAttr SetAttr
Empty space between the cell and next cell in pixels. It is added after right LabelRight if any. Multiplied by IconZoom
It is not read from the Toolbar row.
Tool int

MarginLabel

[6] GetAttr SetAttr
Empty space between the cell label and previous or next cell in pixels.
It is added to MarginLeft before left Label and to MarginRight after right LabelRight if any. Multiplied by IconZoom
Tool int

PaddingLabel

[2] GetAttr SetAttr
Empty space between the cell and its label in pixels.
It is added to PaddingLeft after left Label and to PaddingRight before right LabelRight if any. Multiplied by IconZoom
Tool int

PaddingLeft

[4] GetAttr SetAttr
Space inside cell between the cell left edge and Icon or text in pixels.
Tool int

PaddingRight

[4] GetAttr SetAttr
Space inside cell between the cell right edge and Icon or text in pixels.
Tool int

PaddingText

[2] GetAttr SetAttr
Space inside cell between the cell text and Icon in pixels, only if both are present.

Toolbar position

Toolbar int

Pos

[0] GetAttr SetAttr
Toolbar position relative to the previous toolbar on the same line.
0 - next to direct previous toolbar, always on the top of the line. Using with other Pos values can lead to toolbar overlay.
1 - next to utmost right toolbar on all levels; placed on top of the line.
2 - next to the previous toolbar on top of the line.
3 - next to direct previous toolbar on the same level (the same Y position).
4 - below direct previous toolbar, next to previous toolbar on this level.
5 - below the previous toolbar, aligned to its left (the same X position).
6 - below the previous toolbar without Pos = 3, aligned to its left (the same X position).
The Pos >= 3 cannot be dragged separatelly, it is dragged only with the previous toolbar.
Toolbar bits

NewLine

[0] GetAttr SetAttr
1. bit &1 - new line before - the toolbar always starts on new line from the grid left edge.
2. bit &2 - new line after - the next toolbar always starts on new line from the grid left edge.
RowPart bits

NoWrap

[0] GetPartAttr SetPartAttr
If set, restricts wrapping toolbars vertically in the "Toolbars" row part.
1. bit &1 - restricts automatic wrapping.
2. bit &2 - restricts wrapping by NewLine.
If wrapping is restricted, the toolbars can be hidden because of placing beyond the grid right edge.
Toolbar cannot be wrapped inside itself, so if it is too wide, it can be overflowed by grid right edge.

Dragging and manipulating cells

During toolbar cells dragging are called standard dragging events:
OnStartDrag, OnDragging, OnDrop, OnEndDrag.

Toolbars can be dragged by DragToolbar cell that is shown when set DraggingToolbars.
Cfg int

DraggingTools

[0] GetCfgAttr SetCfgAttr
If set to 0, toolbar cells can be moved according to their NoMove settings.
If set to 1, permits moving all toolbar cells inside their toolbar. Except cells with NoMove&8
If set to 2, permits moving all toolbar cells inside and between toolbars. Except cells with NoMove&8
If set to 3, permits moving all toolbar cells between grids (tested in source grid). Except cells with NoMove&8
It is automatically set by SwitchDraggingToolbars.
Cfg int

DraggingToolbars

[0] / [1] GetCfgAttr SetDraggingToolbars
If set to 0, the toolbars cannot be moved by users and DragToolbar cell is not shown.
If set to 1, shows all toolbars with DragToolbar cell on beginning, but still cannot drag the toolbars.
If set to 2, permits moving toolbars by dragging the DragToolbar cell.
If set to 3, permits moving toolbars by dragging the DragToolbar cell also between grids (tested in source grid).
The toolbars with Pos >= 3 are dragged together with previous toolbar.
For correct dragging the toolbar NewLine should be set only to 0 / 1 and wrapping toolbars should be permitted by the NoWrap = 0.
Cfg int

DraggingToolbarsShift

[0] / [15] GetCfgAttr SetCfgAttr
If set DraggingToolbars = 1, shifts all toolbars to the left by this amount of pixels. To hide the most left DragToolbar icon.
Tool bits

NoMove

[3/8/15] GetAttr SetAttr
1.bit &1 - Toolbar cell cannot be moved inside its toolbar.
2.bit &2 - Toolbar cell cannot be moved to another toolbar.
3.bit &4 - Special toolbar cell with Kind cannot be moved to rows / columns.
4.bit &8 - Toolbar cell cannot be moved on DraggingTools.
If not set, the toolbar cell can be moved according to destination toolbar Accept attribute.
By default it is set to 3 except: in Drag (Group / Hide) toolbar is set to 8 and in Drop cell is set to 15.
Tool bits

NoDuplicate

[3] GetAttr SetAttr
1.bit &1 - Toolbar cell cannot be copied inside its toolbar.
2.bit &2 - Toolbar cell cannot be copied to another toolbar.
3.bit &4 - Special toolbar cell with Kind cannot be copied to rows / columns.
If not set, the toolbar cell can be copied according to destination toolbar Accept attribute.
Tool bool

NoDelete

[1] GetAttr SetAttr
If set, the toolbar cell cannot be deleted by mouse dragging outside the toolbar.
Tool bool

DragToolbar

[0/1] GetAttr SetAttr
If set, dragging the toolbar cell will move the whole toolbar instead of the cell itself.
By default it is set to 1 in DragToolbar cell and 0 in all other cells.
Tool bits

Fix

GetAttr SetAttr
If set, the tollbar cell is fixed to some edge and no cell can be dropped next to it:
1. bit &1 - fixed left, no cell can be dropped left to it.
2. bit &2 - fixed right, no cell can be dropped right to it.
If set, the toolbar cell can be moved by mouse dragging to another position in the same toolbar or to another toolbar, depending on toolbar Accept attribute.
Toolbar string[]

Accept

["Tool"] GetAttr SetAttr
Comma separated string or array of strings.
The toolbar accepts as children dropped items only if their DragId is listed here.
To toolbar there can be dropped rows, columns or toolbar cells.
More control of dropping is done also by toolbar Kind.
Tool string

DragId

["Tool"] GetAttr SetAttr
Toolbar cell identification to accept dropping to toolbar by Accept attribute.
Grid method void

SetDraggingToolbars

(int value)
Sets value to DraggingToolbars and updates all affected toolbars.
Grid method void

SwitchDraggingToolbars

(bool all = 0)
Starts or ends dragging toolbars, sets all required attributes.
For all updates all toolbars in other sheets in book to show the changes.
Grid method Tool

AddTool

(any src = null, Toolbar par = null, Tool next = null, bool copy = 0)
Adds or moves (copy = 0) or copies (copy = 1) toolbar cells inside / into toolbar par.
It moves or copies also from another grid if the src is toolbar cell in another grid.

src specifies the toolbar cell that is added / copied / moved.
It can be Tool object as existing toolbar cell to copy / move.
Or it can be an object to add new cell.
Or it can be string to add new cell with given D and / or id.
Or it can be null to add new empty cell.

par is Toolbar where to add the cell, the cell is added left to the next cell.
If next is null, the cell is added to the end of the par.
At least par or next must be set.

Returns added / moved / copied toolbar cell. Or returns null if nothing was modified.
Grid method bool

RemoveTool

(Tool cell)
Removes given toolbar cell from its toolbar.
Returns true for success and false for error.
API event bool

OnAddTool

(Grid grid, Tool cell, Toolbar toolbar, Tool next, Tool copy)
Called before the toolbar cell added / moved / copied in the toolbar left to the next cell. Called from AddTool method.
copy is set to source cell if it is copied.
Return true to cancel the action. Or modify the cell object and return false.
API event void

OnAddedTool

(Grid grid, Tool cell, Toolbar toolbar, Tool next, Tool copy)
Called after the toolbar cell added / moved / copied in the toolbar left to the next cell. Called from AddTool method.
API event bool

OnRemoveTool

(Grid grid, Tool cell)
Called before the toolbar cell removed from its toolbar. Called from RemoveTool method.
It is not called when moving the cell to another toolbar or grid.
Return true to cancel the action.
API event void

OnRemovedTool

(Grid grid, Tool cell)
Called after the toolbar cell removed from its toolbar. Called from RemoveTool method.
It is not called when moving the cell to another toolbar or grid.

Special toolbars

Toolbar string

Kind

GetAttr
If set, the toolbar has special behavior. It generates its cells according to the specified feature or by OnToolbarCells event. And after drop the cell in or out the toolbar provides specific action.
Hide Shows hidden rows / columns from given Part that are accepted by Accept.
After dragging toolbar cells the rows / columns are hidden / shown in grid.
Group Shows rows / columns listed in Group from given Part that are accepted by Accept.
If the Part contains more parts with different Group attribute, one of them is used randomly.
After dragging toolbar cells the columns / rows are grouped accordingly and the parts' Group attribute is changed.
PivotRows Shows rows / columns listed in PivotRows from given Part that are accepted by Accept.
PivotCols Shows rows / columns listed in PivotCols from given Part that are accepted by Accept.
PivotData Shows rows / columns listed in PivotData from given Part that are accepted by Accept.
Sheets Shows visible sheets from the grid Book.
any_other Custom feature controlled by event OnToolbarCells and dragging events OnStartDrag, OnDragging, OnDrop, OnEndDrag.
Toolbar string[]

Part

GetAttr SetAttr
Comma separated string or array of parts that are affected by toolbar Kind feature.
If not set, all rows and columns that fulfill Accept condition are affected.
API event bool

OnToolbarCells

(Grid grid, Toolbar toolbar)
Called to update cells in toolbar with Kind attribute set.
Use AddTool and RemoveTool methods to manipulate cells.
Return true to not update the cells by standard feature Kind like "Hide" or "Group".