The widget allows you to use the following properties and methods.
-
registerCss
: boolean, whether the CSS file should be registered. -
options
: array, the HTML attributes for the widget container tag. See renderTagAttributes() for details on how attributes are being rendered. -
renderContainer
: boolean, whether the widget content should be included in a div container. -
containerOptions
: array, the HTML attributes for the content container tag. This is only used whenrenderContainer
is true. See renderTagAttributes() for details on how attributes are being rendered. -
templates
: array, templates used to render widget elements, in addition, may be specified the array keys with the HTML attributes for the container tag. Tokens enclosed within curly brackets are treated as controller action IDs (also called element names in the context of action column). They will be replaced by the corresponding element rendering values specified inelements
. For example, the token{bulk-actions}
will be replaced by the result of the valueelements['bulk-actions']
. If a value cannot be found, the token will be replaced with an empty string. See renderTagAttributes() for details on how attributes are being rendered. -
elements
: array, elements rendering values. The array keys are the element names (without curly brackets), and the values are the corresponding element rendering values. -
grid
: string, the grid ID. This property must be set if used the Bulk Actions default element. -
bulkActionsPrompt
: string, the text to the call to action for the Bulk Actions. -
bulkActionsItems
: array, the option data items for the Bulk Actions. See dropDownList() for details on how this is to be rendered. -
bulkActionsOptions
: array, the Bulk Actions options in terms of name-value pairs. The following attributes for the select option tag are specially handled:url
: string, used to send the array with the selected rows (based on the AJAX request) to the clienton the specified URL.data-confirm
: string, displays a confirm box before deleting selected items.
See dropDownList() for details on how this is to be rendered.
t()
: see t() for details on how this is to function.
-
modelClass
: string, the model class name. This property must be set. -
beforeDeleteCallback
: callable, a callback that will be called after deleting selected items. The signature of the callback should be asfunction ($action)
, where$action
is the current action object. -
afterDeleteCallback
: callable, a callback that will be called after deleting selected items. The signature of the callback should be asfunction ($action)
, where$action
is the current action object. -
redirectUrl
: string|array, the URL to be redirected to after deleting.
redirect()
: redirects the browser to the previous page or the specified URL fromredirectUrl
.