Setting Options

var options = {
	allowColDelete: false,
	rowHeight: 40,
	// ...
};

var grid = new DataGridXL("grid", options);

Actions: Cell

allowCellEdit

boolean (default: true)

Defines if user is allowed to edit cell values by keyboard. (This setting does not prevent cut, paste & cell-fill actions from modifying any cell values.)

allowCellFill

boolean (default: true)

Defines if user is allowed to fill cells by dragging fill handle.

related → cellFillDirection

cellFillDirection

string (default: "xy")

Defines cell direction(s) in which user can drag to fill cells. (Setting is ignored if allowCellFill is set to false.)

Values: "x", "y", "xy"

Actions: Clipboard

allowCopy

boolean (default: true)

Defines if user is allowed to copy cell values.

allowCut

boolean (default: true)

Defines if user is allowed to cut cell values.

related → delayedCut

allowPaste

boolean (default: true)

Defines if user is allowed to paste cell values.

delayedCut

boolean (default: true)

If true, actual clearing of values is performed only when pasting (similar to well-known spreadsheet apps). If false, cut will clear values immediately.

Actions: Column

allowColDelete

boolean (default: true)

Defines if user is allowed to delete columns.

allowColInsert

boolean (default: true)

Defines if user is allowed to insert columns.

allowColMove

boolean (default: true)

Defines if user is allowed to move (reorder) columns.

allowColResize

boolean (default: true)

Defines if user is allowed to resize columns.

related → undoableColResize

undoableColResize

boolean (default: false)

Defines if column resize action is undo-able.

Actions: Row

allowRowDelete

boolean (default: true)

Defines if user is allowed to delete rows.

allowRowInsert

boolean (default: true)

Defines if user is allowed to insert rows.

allowRowMove

boolean (default: true)

Defines if user is allowed to move (reorder) rows.

Activation

deactivateOnClickOutside

boolean (default: true)

Defines if grid should deactivate ('unfocus') if user clicks outside the component. Regardless of setting, clicking any HTML element with class .dgxl-app will not deactivate the grid.

instantActivate

boolean (default: false)

Defines if grid should auto-activate (selecting cell 0,0) when it's created. If false, grid is only activated when user clicks inside component.

Axes: Columns

colHeaderHeight

int (default: 38)

Height of column headers in pixels. Applies to all.

colHeaderLabelFunction advanced

Provide a custom function that returns a string label for every column header. Overrides labelType, labelPrefix and labelSuffix options. HTML supported.

colHeaderLabelPrefix

string (default: "")

A string to prepend to column header label.

colHeaderLabelSuffix

string (default: "")

A string to append to column header label.

colHeaderLabelType

string (default: "letters")

Defines label series type for untitled columns. index for 0,1,2; numbers for 1,2,3; letters for A,B,C. id to use column IDs as labels. none for blank headers.

Values: "index", "numbers", "letters", "id", "none"

defaultColAlign

string (default: "left")

Default column alignment. For column header alignment, use defaultColHeaderLabelAlign instead.

Values: "left", "center", "right"

defaultColHeaderLabelAlign

string (default: "left")

Default label alignment of column headers.

Values: "left", "center", "right"

defaultColWidth

int (default: 112)

Default column width in pixels.

showColHeaders

boolean (default: true)

Display column headers true/false.

Axes: Rows

rowHeaderLabelAlign

string (default: "center")

Label alignment of row headers. Applies to all (cannot be set individually).

Values: "left", "center", "right"

rowHeaderLabelFunction advanced

Provide a custom function that returns a string label for every row header. Overrides labelType, labelPrefix and labelSuffix options. (No HTML-support.)

rowHeaderLabelPrefix

string (default: "")

A string to prepend to every row header label.

rowHeaderLabelSuffix

string (default: "")

A string to append to every row header label.

rowHeaderLabelType

string (default: "numbers")

Defines label series type for (untitled) rows. index for 0,1,2; numbers for 1,2,3; letters for A,B,C. id to use row IDs as labels. none for blank headers.

Values: "index", "numbers", "letters", "id", "none"

rowHeaderWidth

int (default: 56)

Width of column that displays row headers (pixels).

rowHeight

int (default: 30)

Row height in pixels. The height applies to every single row in the grid (rows cannot be resized individually).

showRowHeaders

boolean (default: true)

Display row headers true/false.

Context Menu

contextMenuItems

array

Takes an array of context menu items. Supports context menu item presets (strings) & custom defined context menu items (objects). For no context menu, pass an empty array or false.

Context Menu (touch)

contextMenuTouchItems

array

Takes an array of context menu touch items. Supports context menu touch item presets (strings) & custom defined context menu touch items (objects). For no context menu touch, pass an empty array or false.

Data

columns advanced

array

Define initial column-objects. Properties may include title, field, align, width and source.

data

array

Data to be displayed in data grid. Can be either a 2D Array or an Array of Objects (JSON-style). When no data is given, grid will default to an empty 3×3 grid.

Locale

locale

object

Pass in locale settings to override default locale (International English).

Theme

theme

object

Pass in theme settings to override default theme.