Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix the editable in checkboxcolumn
Browse files Browse the repository at this point in the history
  • Loading branch information
natrim committed Aug 28, 2013
1 parent 412623f commit 099d550
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/jquery.ui.gridito.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

el.after($("<label />").attr({ for: el.attr("id") }));

el.button({ text: false, disabled: el.attr("disabled") });
el.button({ text: false, disabled: el[0].disabled });

el.click(function (e) {
$(this).button("option", {
Expand Down
32 changes: 30 additions & 2 deletions src/Gridito/CheckboxColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,35 @@ public function setRenderer($cellRenderer, $rendererParamsNum = 3)
throw new NotImplementedException('Checkbox Column does not support setting custom renderer!');
}

/**
* Get the type of cell
* @return string type
*/
public function getType()
{
return $this->type;
}

/**
* Set editable
* @param bool editable
* @return Column
*/
public function setEditable($editable = TRUE)
{
$this->editable = $editable;
return $this;
}

/**
* Is editable?
* @return bool
*/
public function isEditable()
{
return $this->editable;
}

/**
* Set the type of cell
* @param string type
Expand Down Expand Up @@ -74,10 +103,9 @@ public function renderCell($record)
$value = $this->getGrid()->getModel()->getUniqueId($record);

$column = Html::el('input', array('type' => 'checkbox', 'id' => $this->columnName . $value, 'name' => $this->columnName . '[]', 'value' => (string)$value));
//$column->class[] = 'editable';

if (!$this->editable) {
$column->disabled('disabled');
$column->disabled = 'disabled';
}
echo $column;
}
Expand Down

0 comments on commit 099d550

Please sign in to comment.