@@ -36,6 +36,10 @@ discard block |
||
| 36 | 36 | protected $_targetSelector; |
| 37 | 37 | protected $_checkedMessage; |
| 38 | 38 | |
| 39 | + /** |
|
| 40 | + * @param string $identifier |
|
| 41 | + * @param string $model |
|
| 42 | + */ |
|
| 39 | 43 | public function __construct($identifier,$model,$modelInstance=NULL) { |
| 40 | 44 | parent::__construct($identifier, $model,$modelInstance); |
| 41 | 45 | $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0,0), false); |
@@ -75,6 +79,9 @@ discard block |
||
| 75 | 79 | if(allChecked) {\$parentCheckbox.checkbox('set checked');}else if(allUnchecked){\$parentCheckbox.checkbox('set unchecked');}else{\$parentCheckbox.checkbox('set indeterminate');};".$checkedMessageCall); |
| 76 | 80 | } |
| 77 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $op |
|
| 84 | + */ |
|
| 78 | 85 | protected function _generateBehavior($op,JsUtils $js){ |
| 79 | 86 | if(isset($this->_urls[$op])) |
| 80 | 87 | $js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]); |
@@ -210,6 +217,9 @@ discard block |
||
| 210 | 217 | return $this; |
| 211 | 218 | } |
| 212 | 219 | |
| 220 | + /** |
|
| 221 | + * @param PositionInTable $part |
|
| 222 | + */ |
|
| 213 | 223 | private function addToolbarRow($part,$table,$captions){ |
| 214 | 224 | $hasPart=$table->hasPart($part); |
| 215 | 225 | if($hasPart){ |
@@ -310,6 +320,9 @@ discard block |
||
| 310 | 320 | }, $index,$attributes); |
| 311 | 321 | } |
| 312 | 322 | |
| 323 | + /** |
|
| 324 | + * @param HtmlButton $element |
|
| 325 | + */ |
|
| 313 | 326 | protected function _visibleOver($element){ |
| 314 | 327 | $this->_visibleHover=true; |
| 315 | 328 | return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
@@ -11,14 +11,27 @@ discard block |
||
| 11 | 11 | * @property InstanceViewer $_instanceViewer |
| 12 | 12 | */ |
| 13 | 13 | trait DataTableFieldAsTrait{ |
| 14 | + |
|
| 15 | + /** |
|
| 16 | + * @param \Closure $field |
|
| 17 | + */ |
|
| 14 | 18 | abstract public function addField($field); |
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * @param integer $index |
|
| 22 | + * @param \Closure $field |
|
| 23 | + */ |
|
| 15 | 24 | abstract public function insertField($index,$field); |
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * @param \Closure $field |
|
| 28 | + */ |
|
| 16 | 29 | abstract public function insertInField($index,$field); |
| 17 | 30 | /** |
| 18 | 31 | * @param string $caption |
| 19 | 32 | * @param callable $callback |
| 20 | 33 | * @param boolean $visibleHover |
| 21 | - * @return callable |
|
| 34 | + * @return \Closure |
|
| 22 | 35 | */ |
| 23 | 36 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
| 24 | 37 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -28,7 +41,7 @@ discard block |
||
| 28 | 41 | * @param callable $thisCallback |
| 29 | 42 | * @param array $parameters |
| 30 | 43 | * @param callable $callback |
| 31 | - * @return callable |
|
| 44 | + * @return \Closure |
|
| 32 | 45 | */ |
| 33 | 46 | private function getCallable($thisCallback,$parameters,$callback=null){ |
| 34 | 47 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -66,7 +79,7 @@ discard block |
||
| 66 | 79 | * @param string $caption |
| 67 | 80 | * @param callable $callback |
| 68 | 81 | * @param boolean $visibleHover |
| 69 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 82 | + * @return DataTableFieldAsTrait |
|
| 70 | 83 | */ |
| 71 | 84 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
| 72 | 85 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -78,7 +91,7 @@ discard block |
||
| 78 | 91 | * @param int $index |
| 79 | 92 | * @param string $caption |
| 80 | 93 | * @param callable $callback |
| 81 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 94 | + * @return DataTableFieldAsTrait |
|
| 82 | 95 | */ |
| 83 | 96 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 84 | 97 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -90,18 +103,26 @@ discard block |
||
| 90 | 103 | * @param int $index |
| 91 | 104 | * @param string $caption |
| 92 | 105 | * @param callable $callback |
| 93 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 106 | + * @return DataTableFieldAsTrait |
|
| 94 | 107 | */ |
| 95 | 108 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 96 | 109 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
| 97 | 110 | return $this; |
| 98 | 111 | } |
| 99 | 112 | |
| 113 | + /** |
|
| 114 | + * @param string $icon |
|
| 115 | + * @param string $class |
|
| 116 | + */ |
|
| 100 | 117 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
| 101 | 118 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 102 | 119 | return $this; |
| 103 | 120 | } |
| 104 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $icon |
|
| 124 | + * @param string $class |
|
| 125 | + */ |
|
| 105 | 126 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
| 106 | 127 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 107 | 128 | return $this; |