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 | /** |
||
77 | * @param DataGrid $grid |
||
78 | * @param string|NULL $primary_where_column |
||
79 | */ |
||
80 | public function __construct(DataGrid $grid, $primary_where_column = NULL) |
||
91 | |||
92 | |||
93 | /** |
||
94 | * @param mixed $id |
||
95 | */ |
||
96 | public function setItemId($id) |
||
100 | |||
101 | |||
102 | /** |
||
103 | * @return mixed |
||
104 | */ |
||
105 | public function getItemId() |
||
109 | |||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getPrimaryWhereColumn() |
||
118 | |||
119 | |||
120 | /** |
||
121 | * Render row item detail button |
||
122 | * @param Row $row |
||
123 | * @return Html |
||
124 | */ |
||
125 | public function renderButton($row) |
||
141 | |||
142 | |||
143 | /** |
||
144 | * Render row item detail button |
||
145 | * @return Html |
||
146 | */ |
||
147 | public function renderButtonAdd() |
||
160 | |||
161 | |||
162 | /** |
||
163 | * Setter for inline adding position |
||
164 | * @param bool $position_top |
||
165 | * @return static |
||
166 | */ |
||
167 | public function setPositionTop($position_top = TRUE) |
||
173 | |||
174 | |||
175 | /** |
||
176 | * Getter for inline adding |
||
177 | * @return bool |
||
178 | */ |
||
179 | public function isPositionTop() |
||
183 | |||
184 | |||
185 | /** |
||
186 | * @return bool |
||
187 | */ |
||
188 | public function isPositionBottom() |
||
192 | |||
193 | |||
194 | |||
195 | /** |
||
196 | * @param Nette\Forms\Container $container |
||
197 | */ |
||
198 | public function addControlsClasses(Nette\Forms\Container $container) |
||
221 | |||
222 | } |
||
223 |