forked from yiisoft/yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,10 @@ | |
* Users may click on the checkboxes to select rows of the grid. The selected rows may be | ||
* obtained by calling the following JavaScript code: | ||
* | ||
* ~~~ | ||
* ```javascript | ||
* var keys = $('#grid').yiiGridView('getSelectedRows'); | ||
* // keys is an array consisting of the keys associated with the selected rows | ||
* ~~~ | ||
* ``` | ||
* | ||
* @author Qiang Xue <[email protected]> | ||
* @since 2.0 | ||
|
@@ -46,6 +46,19 @@ class CheckboxColumn extends Column | |
/** | ||
* @var array|\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): | ||
* | ||
* ```php | ||
* 'checkboxOptions' => function($model, $key, $index, $column) { | ||
* return ['value' => $model->name]; | ||
* } | ||
* ``` | ||
* | ||
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. | ||
*/ | ||
public $checkboxOptions = []; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ | |
*/ | ||
class SerialColumn extends Column | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public $header = '#'; | ||
|
||
|
||
|