simple_form
A form. Type is simple_form. Field layout is a DevExtreme dxForm config. Lowercase keys include items, colCount, and labelLocation.
Minimal example
{
Type: "simple_form",
Id: "orderForm",
Option: {
Component: {
AutoLoad: true,
ReadOnly: false
},
Toolbar: {
visible: true,
Items: { Reload: true, Save: true, New: true }
},
Form: {
LoadSql: { sql_id: 210 },
SaveSql: { sql_id: 211 },
items: [
{ dataField: "code", label: { text: "Order no." }, IsUser: false },
{ dataField: "buyer_id", label: { text: "Buyer" }, IsUser: true }
]
}
}
}Toolbar.visible and Toolbar.items are native dxToolbar keys. Turning buttons on by name is still Items. Custom buttons are MoreItems. The engine merges both into items.
Buttons that belong to a grid do nothing on a form: AddRow, AddRowsBatch, CloneRows, ReplaceRow, DeleteRow, MoveUp, MoveDown, ExpandAll, CollapseAll, Import, Export, WrapText, ToggleFilterRow, ResetLayout, and the DevExtreme items groupPanel, searchPanel, columnChooserButton.
Platform keys on Form
| Key | Meaning |
|---|---|
LoadSql | Load the form data |
SaveSql | Save the form |
AfterSave | After save. It can hold FormSql, GridSql, and Js |
ForceDesktop | Keep the desktop layout. Do not change the column count with the screen width |
OnRefresh | Function called after a refresh. Page JSON is parsed with eval, so write a function here |
DependentFields | Dependencies between fields. Write this when changing A must recompute B |
IsUser: true on a form item means the field stores a user id. The field-permission page uses it to build a “is the current user” condition.
AutoLoad, ReadOnly, DataPool, Init, and Auth on Component mean the same as on data_grid.