@@ -403,9 +403,10 @@ public function getQualifiedTitle($title)
403403 * Add a checkbox column.
404404 *
405405 * @param array $attributes
406+ * @param bool|int $position true to prepend, false to append or a zero-based index for positioning
406407 * @return $this
407408 */
408- public function addCheckbox (array $ attributes = [])
409+ public function addCheckbox (array $ attributes = [], $ position = false )
409410 {
410411$ attributes =array_merge ([
411412'defaultContent ' =>'<input type="checkbox" ' .$ this ->html ->attributes ($ attributes ) .'/> ' ,
@@ -418,7 +419,15 @@ public function addCheckbox(array $attributes = [])
418419'printable ' =>true ,
419420'width ' =>'10px ' ,
420421 ],$ attributes );
421- $ this ->collection ->push (new Column ($ attributes ));
422+ $ column =new Column ($ attributes );
423+
424+ if ($ position ===true ) {
425+ $ this ->collection ->prepend ($ column );
426+ }elseif ($ position ===false ||$ position >=$ this ->collection ->count ()) {
427+ $ this ->collection ->push ($ column );
428+ }else {
429+ $ this ->collection ->splice ($ position ,0 , [$ column ]);
430+ }
422431
423432return $ this ;
424433 }