Skip to content

Commit 423038c

Browse files
authored
Merge pull request #144 from yajra/function-template-options
Add function argument to override the default options from php scripts.
2 parents ef4035d + 70149a7 commit 423038c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/resources/views/function.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
window.dtx = window.dtx || {};
2-
window.dtx["%1$s"] = function() {
2+
window.dtx["%1$s"] = function(opts) {
33
window.LaravelDataTables = window.LaravelDataTables || {};
44
@if(isset($editors))
55
@foreach($editors as $editor)
@@ -10,5 +10,5 @@
1010
@endforeach
1111
@endforeach
1212
@endif
13-
return $("#%1$s").DataTable(%2$s);
13+
return window.LaravelDataTables["%1$s"] = $("#%1$s").DataTable($.extend(%2$s, opts));
1414
}

0 commit comments

Comments
 (0)