Skip to content

Commit 96f7902

Browse files
authored
Adding dataTableVariable property
1 parent 2e2adf7 commit 96f7902

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Services/DataTable.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ abstract class DataTable implements DataTableButtons
1818
* @var string
1919
*/
2020
protected $printPreview = 'datatables::print';
21-
21+
22+
/**
23+
* Name of the dataTable variable
24+
*
25+
* @var string
26+
*/
27+
protected $dataTableVariable = 'dataTable';
28+
2229
/**
2330
* List of columns to be exported.
2431
*
@@ -118,7 +125,7 @@ public function render($view, $data = [], $mergeData = [])
118125
return app()->call([$this, $action]);
119126
}
120127

121-
return view($view, $data, $mergeData)->with('dataTable', $this->getHtmlBuilder());
128+
return view($view, $data, $mergeData)->with($this->dataTableVariable, $this->getHtmlBuilder());
122129
}
123130

124131
/**

0 commit comments

Comments
 (0)