Skip to content

data_grid ​

A grid. Type is data_grid.

Lowercase keys in Option.Grid are dxDataGrid options. Common ones are columns, keyExpr, editing, and toolbar. The tables below are only the keys this platform adds.

Minimal example ​

javascript
{
  Type: "data_grid",
  Id: "orders",
  Option: {
    Component: {
      AutoLoad: true,
      LoadSql: { sql_id: 100 },
      UpdateRowSql: { sql_id: 101 },
      IdField: "id"
    },
    Toolbar: {
      Items: { Reload: true, Save: true, AddRow: true }
    },
    Grid: {
      keyExpr: "id",
      columns: [
        { dataField: "code", caption: "Order no." },
        { dataField: "amount", caption: "Amount", ValidRequired: true },
        { dataField: "owner_id", visible: false, KeepData: true }
      ]
    }
  }
}

Component ​

KeyMeaning
AutoLoadRun LoadSql as soon as the page opens
ReadOnlyThe whole grid is read-only
Width / HeightComponent size
LoadSqlQuery. sql_id inside the object points at sys.page_sql
InsertRowSqlInsert one row
UpdateRowSqlUpdate one row
DeleteRowSqlDelete one row
InsertRowWithIdSqlInsert an empty row and return its id
AfterSaveSqlSQL to run after a save
AfterInsertRow"js:" to run after an insert
AfterUpdateRow"js:" to run after an update
AfterDeleteRow"js:" to run after a delete
NewSqlSQL for the toolbar New action
NewRowsSqlSQL that creates several rows at once
CloneSqlClone the current document
CloneRowsSqlClone rows
DeleteSqlToolbar action that deletes the document. Deleting one grid row uses DeleteRowSql
IdFieldPrimary-key field name
SeqFieldOrder field, read and written by move up and move down
UniqueFieldField used to decide that a row is a duplicate
RowDefaultsDefault values for a new row
DataPoolNamed data sets. A column refers to one with FromPool
InitInitial values. Init.MainSelect is the initial value of the main select, and it may be "js:"
RowUnselectableExprWhich rows cannot be selected, as "js:"
RememberSelectionRemember the current selection
AppendBlankColumnAdd a blank column at the end so the last real column is not stretched
DynamicColumnsDynamic columns. Holds Column (the column definition) and LoadSql
ImportImport. Holds Sql, Batch, and ChunkSize
AuthSwitches for how permissions behave on this page

ActionAuthTriState, ColumnAuthTriState, FormFieldAuthTriState, SyncActionsOnSelect, SyncColumnsOnSelect, and SyncFormFieldsOnSelect belong to the permission-setup pages. A business page does not write them.

Inside LoadSql and the other SQL objects, sql_id sits beside the other parameters:

javascript
LoadSql: { sql_id: 100, status: "open" }

Toolbar ​

Keys of Items are button names. The value is true, false, or a toolbar-item config. MoreItems is an array of custom buttons.

ButtonWhat it does
MainSelectMain select. The chosen value is a parameter of later SQL
NewNew document
CloneClone
DeleteDelete the document
SendSend the document
SaveSave
ReloadReload
Filter / Filter2Two filter boxes
DateA single date
StartDate / EndDateA date range
StartTime / EndTimeA time range
AddRowAdd one row
AddRowsBatchAdd rows in a batch
AddFolderAdd a group row
CloneFromClone in from a picker
CloneRowsClone the selected rows
ReplaceRowReplace the selected row
DeleteRowDelete the selected row
MoveUp / MoveDownMove up, move down
ExpandAll / CollapseAllExpand all, collapse all
Import / ExportImport, export
WrapTextWrap cell text
ToggleHeaderRowShow or hide the header row
ToggleFilterRowShow or hide the filter row
ResetLayoutRestore column widths and order

A toolbar item can also carry:

KeyMeaning
LoadWhenEmptyAllow loading while the select is still empty
DeleteNowDelete immediately, without waiting for Save
OperationIndexWhich entry in Operations runs when this button is clicked
CallMethodMethod name to call on the component

DevExtreme’s own toolbar items stay lowercase, for example searchPanel and columnChooserButton.

Platform keys on Grid ​

These keys sit on Option.Grid, next to columns:

KeyMeaning
VerticalAlignVertical alignment of cells
MergeBaseFieldWhich field decides that cells belong to the same merge group
StateListList used for column state

Platform keys on a column ​

These keys sit on one entry of Grid.columns[], next to dataField and caption. dataField, caption, visible, dataType, and lookup are DevExtreme keys.

KeyMeaning
KeepDataKeep the field in the result when the column is hidden. See Page JSON
DefaultDefault value for this column on a new row
WrapWrap this column
HelpHelp text on the column header
MergeCellsMerge this column using MergeBaseField
ValidRequiredRequired before save
ValidExprValidation expression before save
ValidSkipOnSaveSkip this column’s validation on save
BoolAsNumThe checkbox is boolean on screen and stored as 0 and 1

A column lookup can fill its dropdown with LoadSql. Put dataSource: [] beside it, then use InitSql.

Blocks that go with buttons ​

These blocks sit next to Component. They describe what opens, and which SQL runs, after a button click.

BlockKeys inside
OperationsName, Version, Popup, Sql, RunJs, GotoPage, ReloadAfter, Grid
Operations[].PopupForm, DisableOk, DisableCancel, When
Operations[].GotoPagePageId, Title, Params, When
PickersA picker. Name, LoadSql, Grid, Popup, Fetch
Pickers[].FetchSql, FromField, ToParam, UniqueField
AddRowByFormEnabled, OperationIndex, SaveNow, RowIterator
AddRowByPicker / AddRowsBatchByPicker / ReplaceRowByPicker / CloneByPickerEnabled, PickerIndex, WrapAsFolders, FolderNameField

When, RunJs, and RowIterator may be "js:".

This describes the platform. One customer’s business tables are not in these docs.