New feature: allow disabled checkboxes #1369

Merged
merged 2 commits into from Sep 11, 2012

Conversation

4 participants
Contributor

sucotronic commented Sep 10, 2012

This modification enables the CCheckBoxColumn to disable some columns, and avoid to get them selected when clicking the upper checkbox (to select/deselect all).

@creocoder creocoder commented on an outdated diff Sep 10, 2012

framework/zii/widgets/grid/CCheckBoxColumn.php
@@ -53,6 +53,13 @@ class CCheckBoxColumn extends CGridColumn
*/
public $checked;
/**
+ * @var string a PHP expression that will be evaluated for every data cell and whose result will
+ * determine if checkbox for each data cell is disabled. In this expression, the variable
+ * <code>$row</code> the row number (zero-based); <code>$data</code> the data model for the row;
+ * and <code>$this</code> the column object.
+ */
+ public $disabled=null;
@creocoder

creocoder Sep 10, 2012

Contributor

Change to
public $disabled;

@creocoder creocoder commented on an outdated diff Sep 10, 2012

framework/zii/widgets/grid/CCheckBoxColumn.php
@@ -53,6 +53,13 @@ class CCheckBoxColumn extends CGridColumn
*/
public $checked;
/**
+ * @var string a PHP expression that will be evaluated for every data cell and whose result will
+ * determine if checkbox for each data cell is disabled. In this expression, the variable
+ * <code>$row</code> the row number (zero-based); <code>$data</code> the data model for the row;
+ * and <code>$this</code> the column object.
+ */
@creocoder

creocoder Sep 10, 2012

Contributor

Add
@since 1.1.13

samdark was assigned Sep 11, 2012

@samdark samdark added a commit that referenced this pull request Sep 11, 2012

@samdark samdark Enh #1369: Added CCheckBoxColumn::disabled that accepts PHP expressio…
…n or anonymous function determining if checkbox for the row should be disabled
2e9fd7e

@samdark samdark merged commit ed04f69 into yiisoft:master Sep 11, 2012

Owner

samdark commented Sep 11, 2012

Thanks for working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment