@@ -151,6 +151,10 @@ public function createView()
151151 $ columns = $ this ->columnBuilder ->buildColumnsArray ();
152152
153153 if ($ this ->tableOptions ['enableCheckbox ' ]) {
154+ if (!$ this ->columnBuilder ->getColumnByField ($ this ->tableOptions ['bulkIdentifier ' ])) {
155+ throw new \Exception ("Field for bulk identifier not found in columns. Given identifier: " . $ this ->tableOptions ['bulkIdentifier ' ]);
156+ }
157+
154158 array_unshift ($ columns , array ("checkbox " => true ));
155159 }
156160
@@ -298,14 +302,17 @@ protected function configureTableOptions(OptionsResolver $resolver)
298302 $ resolver ->setDefaults (array (
299303 'tableClassNames ' => 'table table-striped table-sm ' ,
300304 'enableCheckbox ' => false ,
305+ 'bulkIdentifier ' => 'id ' ,
301306 'bulkUrl ' => '' ,
302307 'bulkActionSelectClassNames ' => 'form-control ' ,
303308 'bulkActions ' => array (),
304309 'bulkButtonName ' => 'Okay ' ,
305310 'bulkButtonClassNames ' => 'btn btn-primary '
306311 ));
307312
313+ $ resolver ->setAllowedTypes ("tableClassNames " , ["string " ]);
308314 $ resolver ->setAllowedTypes ("enableCheckbox " , ["bool " ]);
315+ $ resolver ->setAllowedTypes ("bulkIdentifier " , ["string " ]);
309316 $ resolver ->setAllowedTypes ("bulkUrl " , ["string " ]);
310317 $ resolver ->setAllowedTypes ("bulkActionSelectClassNames " , ["string " ]);
311318 $ resolver ->setAllowedTypes ("bulkActions " , ["array " ]);
0 commit comments