Skip to content

Commit 4dd4757

Browse files
authored
Merge branch '4.0' into 4.0
2 parents f46aa99 + 81f1e31 commit 4dd4757

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
## CHANGELOG
1010

11+
### v4.30.2 - 10-06-2020
12+
13+
- Fix chrome bfcache issue with editor. [#139], credits to @jiwom
14+
- Allow using callbacks as a data value. [#127], credits to @mgralikowski
15+
1116
### v4.30.1 - 09-29-2020
1217

1318
- Fix [#134] laravel 8 dependencies [#135], credits to @dyanakiev.
@@ -668,6 +673,8 @@ To `created_at` with title `Created At`
668673
[#125]: https://github.com/yajra/laravel-datatables-html/pull/125
669674
[#131]: https://github.com/yajra/laravel-datatables-html/pull/131
670675
[#135]: https://github.com/yajra/laravel-datatables-html/pull/135
676+
[#127]: https://github.com/yajra/laravel-datatables-html/pull/127
677+
[#139]: https://github.com/yajra/laravel-datatables-html/pull/139
671678

672679
[#134]: https://github.com/yajra/laravel-datatables-html/issues/134
673680
[#3]: https://github.com/yajra/laravel-datatables-html/issues/3

src/Html/Builder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ protected function makeDataScript(array $data)
260260
{
261261
$script = '';
262262
foreach ($data as $key => $value) {
263-
$script .= PHP_EOL . "data.{$key} = '{$value}';";
263+
$dataValue = $this->isCallbackFunction($value, $key) ? $value : "'{$value}'";
264+
$script .= PHP_EOL . "data.{$key} = {$dataValue};";
264265
}
265266

266267
return $script;

src/resources/views/editor.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
$(function(){
2+
window.LaravelDataTables = window.LaravelDataTables || {};
23
$.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{csrf_token()}}'}});
34
@foreach($editors as $editor)
45
var {{$editor->instance}} = window.LaravelDataTables["%1$s-{{$editor->instance}}"] = new $.fn.dataTable.Editor({!! $editor->toJson() !!});

0 commit comments

Comments
 (0)