Closure the HTML attributes for checkboxes. This can either be an array of
attributes or an anonymous function ([[Closure]]) that returns such an array.
The signature of the function should be the following: function (model, key, index, column)
.
Where model
, key
, and index
refer to the model, key and index of the row currently being rendered
and column
is a reference to the CheckboxColumn object.
A function may be used to assign different attributes to different rows based on the data in that row.
Specifically if you want to set a different value for the checkbox
you can use this option in the following way (in this example using the name
attribute of the model):
checkboxOptions: function (model, key, index, column) {
return {value: model.name};
}
This is a callable that will be used to generate the content of each cell.
The signature of the function should be the following: function (model, key, index, column)
.
Where model
, key
, and index
refer to the model, key and index of the row currently being rendered
and column
is a reference to the Column object.
Closure the HTML attributes for the data cell tag. This can either be an array of
attributes or an anonymous function ([[Closure]]) that returns such an array.
The signature of the function should be the following: function (model, key, index, column)
.
Where model
, key
, and index
refer to the model, key and index of the row currently being rendered
and column
is a reference to the Column object.
A function may be used to assign different attributes to different rows based on the data in that row.
The css class that will be used to find the checkboxes.
The HTML attributes for the filter cell tag.
The footer cell content. Note that it will not be HTML-encoded.
The HTML attributes for the footer cell tag.
The grid view object that owns this column.
The header cell content. Note that it will not be HTML-encoded.
The HTML attributes for the header cell tag.
A Promise which resolves when this Component has been successfully initialized.
Whether it is possible to select multiple rows. Defaults to true
.
The name of the input checkbox input fields. This will be appended with []
to ensure it is an array.
The HTML attributes for the column group tag.
Whether this column is visible. Defaults to true.
Returns header cell label. This method may be overridden to customize the label of the header cell.
label
header checkbox name
{@inheritdoc}
Registers the needed JavaScript.
Renders a data cell.
the data model being rendered
the key associated with the data model
the zero-based index of the data item among the item array returned by GridView.dataProvider.
the rendering result
Renders the data cell content.
the data model
the key associated with the data model
the zero-based index of the data model among the models array returned by GridView.dataProvider.
the rendering result
Renders the filter cell.
Renders the filter cell content. The default implementation simply renders a space. This method may be overridden to customize the rendering of the filter cell (if any).
the rendering result
Renders the footer cell.
Renders the footer cell content. The default implementation simply renders footer. This method may be overridden to customize the rendering of the footer cell.
the rendering result
Renders the header cell.
Renders the header cell content. The default implementation simply renders header. This method may be overridden to customize the rendering of the header cell.
the rendering result
Generated using TypeDoc
CheckboxColumn displays a column of checkboxes in a grid view.
To add a CheckboxColumn to the GridView, add it to the columns configuration as follows:
Users may click on the checkboxes to select rows of the grid. The selected rows may be obtained by calling the following JavaScript code:
For more details and usage information on CheckboxColumn, see the guide article on data widgets.