@@ -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){ |
@@ -12,14 +12,27 @@ discard block |
||
| 12 | 12 | * @property InstanceViewer $_instanceViewer |
| 13 | 13 | */ |
| 14 | 14 | trait DataTableFieldAsTrait{ |
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * @param \Closure $field |
|
| 18 | + */ |
|
| 15 | 19 | abstract public function addField($field); |
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @param integer $index |
|
| 23 | + * @param \Closure $field |
|
| 24 | + */ |
|
| 16 | 25 | abstract public function insertField($index,$field); |
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @param \Closure $field |
|
| 29 | + */ |
|
| 17 | 30 | abstract public function insertInField($index,$field); |
| 18 | 31 | /** |
| 19 | 32 | * @param string $caption |
| 20 | 33 | * @param callable $callback |
| 21 | 34 | * @param boolean $visibleHover |
| 22 | - * @return callable |
|
| 35 | + * @return \Closure |
|
| 23 | 36 | */ |
| 24 | 37 | private function getFieldButtonCallable($caption,$visibleHover=true,$callback=null){ |
| 25 | 38 | return $this->getCallable("getFieldButton",[$caption,$visibleHover],$callback); |
@@ -29,7 +42,7 @@ discard block |
||
| 29 | 42 | * @param callable $thisCallback |
| 30 | 43 | * @param array $parameters |
| 31 | 44 | * @param callable $callback |
| 32 | - * @return callable |
|
| 45 | + * @return \Closure |
|
| 33 | 46 | */ |
| 34 | 47 | private function getCallable($thisCallback,$parameters,$callback=null){ |
| 35 | 48 | $result=function($instance) use($thisCallback,$parameters,$callback){ |
@@ -81,6 +94,9 @@ discard block |
||
| 81 | 94 | }, $index,$attributes); |
| 82 | 95 | } |
| 83 | 96 | |
| 97 | + /** |
|
| 98 | + * @param HtmlButton $element |
|
| 99 | + */ |
|
| 84 | 100 | protected function _visibleOver($element){ |
| 85 | 101 | $this->_visibleHover=true; |
| 86 | 102 | return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;"); |
@@ -91,7 +107,7 @@ discard block |
||
| 91 | 107 | * @param string $caption |
| 92 | 108 | * @param callable $callback |
| 93 | 109 | * @param boolean $visibleHover |
| 94 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 110 | + * @return DataTableFieldAsTrait |
|
| 95 | 111 | */ |
| 96 | 112 | public function addFieldButton($caption,$visibleHover=true,$callback=null){ |
| 97 | 113 | $this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback)); |
@@ -103,7 +119,7 @@ discard block |
||
| 103 | 119 | * @param int $index |
| 104 | 120 | * @param string $caption |
| 105 | 121 | * @param callable $callback |
| 106 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 122 | + * @return DataTableFieldAsTrait |
|
| 107 | 123 | */ |
| 108 | 124 | public function insertFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 109 | 125 | $this->insertField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
@@ -115,18 +131,26 @@ discard block |
||
| 115 | 131 | * @param int $index |
| 116 | 132 | * @param string $caption |
| 117 | 133 | * @param callable $callback |
| 118 | - * @return \Ajax\semantic\widgets\datatable\DataTable |
|
| 134 | + * @return DataTableFieldAsTrait |
|
| 119 | 135 | */ |
| 120 | 136 | public function insertInFieldButton($index,$caption,$visibleHover=true,$callback=null){ |
| 121 | 137 | $this->insertInField($index, $this->getFieldButtonCallable($caption,$visibleHover,$callback)); |
| 122 | 138 | return $this; |
| 123 | 139 | } |
| 124 | 140 | |
| 141 | + /** |
|
| 142 | + * @param string $icon |
|
| 143 | + * @param string $class |
|
| 144 | + */ |
|
| 125 | 145 | private function addDefaultButton($icon,$class=null,$visibleHover=true,$callback=null){ |
| 126 | 146 | $this->addField($this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 127 | 147 | return $this; |
| 128 | 148 | } |
| 129 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $icon |
|
| 152 | + * @param string $class |
|
| 153 | + */ |
|
| 130 | 154 | private function insertDefaultButtonIn($index,$icon,$class=null,$visibleHover=true,$callback=null){ |
| 131 | 155 | $this->insertInField($index,$this->getCallable("getDefaultButton",[$icon,$class,$visibleHover],$callback)); |
| 132 | 156 | return $this; |