1 | <?php |
||
17 | class InlineEdit extends Nette\Object |
||
18 | { |
||
19 | |||
20 | use Traits\ButtonIconTrait; |
||
21 | |||
22 | /** |
||
23 | * @var callable[] |
||
24 | */ |
||
25 | public $onSubmit; |
||
26 | |||
27 | /** |
||
28 | * @var callable[] |
||
29 | */ |
||
30 | public $onControlAdd; |
||
31 | |||
32 | /** |
||
33 | * @var callable[] |
||
34 | */ |
||
35 | public $onSetDefaults; |
||
36 | |||
37 | /** |
||
38 | * @var mixed |
||
39 | */ |
||
40 | protected $item_id; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $title; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $class = 'btn btn-xs btn-default ajax'; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $icon = 'pencil'; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $text = ''; |
||
61 | |||
62 | /** |
||
63 | * @var DataGrid |
||
64 | */ |
||
65 | protected $grid; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $primary_where_column; |
||
71 | |||
72 | |||
73 | /** |
||
74 | * @param DataGrid $grid |
||
75 | * @param string $primary_where_column |
||
76 | */ |
||
77 | public function __construct(DataGrid $grid, $primary_where_column) |
||
82 | |||
83 | |||
84 | /** |
||
85 | * @param mixed $id |
||
86 | */ |
||
87 | public function setItemId($id) |
||
91 | |||
92 | |||
93 | /** |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function getItemId() |
||
100 | |||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getPrimaryWhereColumn() |
||
109 | |||
110 | |||
111 | /** |
||
112 | * Render row item detail button |
||
113 | * @param Row $row |
||
114 | * @return Html |
||
115 | */ |
||
116 | public function renderButton($row) |
||
130 | |||
131 | |||
132 | /** |
||
133 | * Set attribute title |
||
134 | * @param string $title |
||
135 | */ |
||
136 | public function setTitle($title) |
||
142 | |||
143 | |||
144 | /** |
||
145 | * Get attribute title |
||
146 | * @return string |
||
147 | */ |
||
148 | public function getTitle() |
||
152 | |||
153 | |||
154 | /** |
||
155 | * Set attribute class |
||
156 | * @param string $class |
||
157 | */ |
||
158 | public function setClass($class) |
||
164 | |||
165 | |||
166 | /** |
||
167 | * Get attribute class |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getClass() |
||
174 | |||
175 | |||
176 | /** |
||
177 | * Set icon |
||
178 | * @param string $icon |
||
179 | */ |
||
180 | public function setIcon($icon) |
||
186 | |||
187 | |||
188 | /** |
||
189 | * Get icon |
||
190 | * @return string |
||
191 | */ |
||
192 | public function getIcon() |
||
196 | |||
197 | |||
198 | /** |
||
199 | * Set text |
||
200 | * @param string $text |
||
201 | */ |
||
202 | public function setText($text) |
||
208 | |||
209 | |||
210 | /** |
||
211 | * Get text |
||
212 | * @return string |
||
213 | */ |
||
214 | public function getText() |
||
218 | |||
219 | } |
||
220 |