diff --git a/src/Html/DataTableHtml.php b/src/Html/DataTableHtml.php index db73253..d107bdc 100644 --- a/src/Html/DataTableHtml.php +++ b/src/Html/DataTableHtml.php @@ -44,6 +44,13 @@ protected function getHtmlBuilder(): Builder $this->htmlBuilder = app(Builder::class); + $this->htmlBuilder + ->postAjax($this->ajax()) + ->setTableId($this->tableId) + ->selectSelector() + ->selectStyleOs() + ->addScript('datatables::functions.batch_remove'); + $this->options($this->htmlBuilder); if ($this->buttons()) { @@ -63,12 +70,7 @@ protected function getHtmlBuilder(): Builder public function handle(): Builder { - return $this->getHtmlBuilder() - ->setTableId($this->tableId) - ->selectSelector() - ->selectStyleOs() - ->postAjax($this->ajax()) - ->addScript('datatables::functions.batch_remove'); + return $this->getHtmlBuilder(); } public function setHtmlBuilder(Builder $builder): static