Columns.command
configurationThe configuration of the column command(s). If set the column would display a button for every command. Commands can be custom or built-in ("edit" or "destroy").
The "edit" built-in command switches the current table row in edit mode.
The "destroy" built-in command removes the data item to which the current table row is bound.
Custom commands are supported by specifying the click option.
The built-in "edit" and "destroy" commands work only if editing is enabled via the editable option. The "edit" command supports "inline" and "popup" editing modes.
columns.command
String|ArrayThe CSS class applied to the command button.
columns.command.click
FunctionThe JavaScript function executed when the user clicks the command button. The function receives a jQuery Event as an argument.
The function context (available via the this keyword) will be set to the grid instance.
Grid custom commands are rendered as anchors (
<a>) with nohrefvalue. Prevent the click event in the click function in order to avoid shifting of the page scroll position.
columns.command.iconClass
String|ObjectThe class for the web font icon of the button. When it is defined as an object it allows to customize the web font icon for the "edit", "update" and "cancel" command buttons.
Grid commands are rendered as anchors (
<a>) with aspaninside. The icon for the button depends on the iconClass which is rendered as a class for the inner span. Default commands have a predefined iconClass value.
columns.command.name
StringThe name of the command. The built-in commands are "edit" and "destroy". Can be set to a custom value.
columns.command.template
StringThe template of the command column.
Add the
k-grid-[command.name]to any element in the template which requires theclickhandler to be called.
columns.command.text
String|ObjectThe text displayed by the command button and the "cancel", "edit" and "update" texts of the edit command. If not set the name option is used as the button text.
columns.command.visible
FunctionThe JavaScript function executed on initialization of the row which will determine whether the command button will be visible. The function receives a the data item object for the row as an argument.