Skip to content

Commit 1a5b9fd

Browse files
authored
Merge pull request #200 from yajra/fix-ajax-override
fix: defaults override via options
2 parents 034e089 + 1252e56 commit 1a5b9fd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Html/DataTableHtml.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ protected function getHtmlBuilder(): Builder
4444

4545
$this->htmlBuilder = app(Builder::class);
4646

47+
$this->htmlBuilder
48+
->postAjax($this->ajax())
49+
->setTableId($this->tableId)
50+
->selectSelector()
51+
->selectStyleOs()
52+
->addScript('datatables::functions.batch_remove');
53+
4754
$this->options($this->htmlBuilder);
4855

4956
if ($this->buttons()) {
@@ -63,12 +70,7 @@ protected function getHtmlBuilder(): Builder
6370

6471
public function handle(): Builder
6572
{
66-
return $this->getHtmlBuilder()
67-
->setTableId($this->tableId)
68-
->selectSelector()
69-
->selectStyleOs()
70-
->postAjax($this->ajax())
71-
->addScript('datatables::functions.batch_remove');
73+
return $this->getHtmlBuilder();
7274
}
7375

7476
public function setHtmlBuilder(Builder $builder): static

0 commit comments

Comments
 (0)