1 | <?php |
||
24 | class InlineEdit extends Nette\Object |
||
25 | { |
||
26 | |||
27 | use Traits\TButton; |
||
28 | |||
29 | /** |
||
30 | * @var callable[] |
||
31 | */ |
||
32 | public $onSubmit; |
||
33 | |||
34 | /** |
||
35 | * @var callable[] |
||
36 | */ |
||
37 | public $onControlAdd; |
||
38 | |||
39 | /** |
||
40 | * @var callable[] |
||
41 | */ |
||
42 | public $onControlAfterAdd; |
||
43 | |||
44 | /** |
||
45 | * @var callable[] |
||
46 | */ |
||
47 | public $onSetDefaults; |
||
48 | |||
49 | /** |
||
50 | * @var callable[] |
||
51 | */ |
||
52 | public $onCustomRedraw; |
||
53 | |||
54 | /** |
||
55 | * @var mixed |
||
56 | */ |
||
57 | protected $item_id; |
||
58 | |||
59 | /** |
||
60 | * @var DataGrid |
||
61 | */ |
||
62 | protected $grid; |
||
63 | |||
64 | /** |
||
65 | * @var string|NULL |
||
66 | */ |
||
67 | protected $primary_where_column; |
||
68 | |||
69 | /** |
||
70 | * Inline adding - render on the top or in the bottom? |
||
71 | * @var bool |
||
72 | */ |
||
73 | protected $position_top = FALSE; |
||
74 | |||
75 | /** |
||
76 | * Columns that are not edited can displey normal value instaad of nothing.. |
||
77 | * @var bool |
||
78 | */ |
||
79 | protected $showNonEditingColumns = FALSE; |
||
80 | |||
81 | |||
82 | /** |
||
83 | * @param DataGrid $grid |
||
84 | * @param string|NULL $primary_where_column |
||
85 | */ |
||
86 | public function __construct(DataGrid $grid, $primary_where_column = NULL) |
||
97 | |||
98 | |||
99 | /** |
||
100 | * @param mixed $id |
||
101 | */ |
||
102 | public function setItemId($id) |
||
106 | |||
107 | |||
108 | /** |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function getItemId() |
||
115 | |||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getPrimaryWhereColumn() |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Render row item detail button |
||
128 | * @param Row $row |
||
129 | * @return Html |
||
130 | */ |
||
131 | public function renderButton($row) |
||
147 | |||
148 | |||
149 | /** |
||
150 | * Render row item detail button |
||
151 | * @return Html |
||
152 | */ |
||
153 | public function renderButtonAdd() |
||
166 | |||
167 | |||
168 | /** |
||
169 | * Setter for inline adding position |
||
170 | * @param bool $position_top |
||
171 | * @return static |
||
172 | */ |
||
173 | public function setPositionTop($position_top = TRUE) |
||
179 | |||
180 | |||
181 | /** |
||
182 | * Getter for inline adding |
||
183 | * @return bool |
||
184 | */ |
||
185 | public function isPositionTop() |
||
189 | |||
190 | |||
191 | /** |
||
192 | * @return bool |
||
193 | */ |
||
194 | public function isPositionBottom() |
||
198 | |||
199 | |||
200 | |||
201 | /** |
||
202 | * @param Nette\Forms\Container $container |
||
203 | */ |
||
204 | public function addControlsClasses(Nette\Forms\Container $container) |
||
227 | |||
228 | |||
229 | /** |
||
230 | * @param bool $show |
||
231 | */ |
||
232 | public function setShowNonEditingColumns($show = TRUE) |
||
236 | |||
237 | |||
238 | /** |
||
239 | * @return bool |
||
240 | */ |
||
241 | public function showNonEditingColumns() |
||
245 | |||
246 | } |
||
247 |