From c3cc581b5103de4ce869f4695d5c1673e06bcc6c Mon Sep 17 00:00:00 2001 From: Kurtas Date: Tue, 31 Jul 2012 00:52:18 +0300 Subject: [PATCH] Update Components/Column.php Moznost nastavit readonly datepickers inputy --- Components/Column.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Components/Column.php b/Components/Column.php index 57ea544..8946134 100644 --- a/Components/Column.php +++ b/Components/Column.php @@ -279,13 +279,13 @@ public function setBooleanEditable() * @return Column * @throws DuplicateEditableColumnException */ - public function setDateEditable() + public function setDateEditable($readonly = false) { if($this->editable){ throw new DuplicateEditableColumnException("Column $this->name is already editable."); } $this->parent['gridForm'][$this->parent->name]['rowForm']->addText($this->name, NULL)->getControlPrototype()->addClass("grid-datepicker")->addClass("grid-editable"); - + if($readonly) $this->parent['gridForm'][$this->parent->name]['rowForm'][$this->name]->getControlPrototype()->readonly("readonly"); $this->editable = TRUE; return $this; @@ -367,9 +367,10 @@ public function setSelectFilter($values, $prompt = "-----") /** * @return Column */ - public function setDateFilter() + public function setDateFilter($readonly = false) { $this->parent['gridForm'][$this->parent->name]['filter']->addText($this->name, $this->label.":")->getControlPrototype()->class("grid-datepicker"); + if($readonly) $this->parent['gridForm'][$this->parent->name]['filter'][$this->name]->getControlPrototype()->readonly("readonly"); $this->filterType = FilterCondition::DATE; return $this;