We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 925f6c6 commit b2d6538Copy full SHA for b2d6538
src/Html/Options/HasCallbacks.php
@@ -37,6 +37,29 @@ public function drawCallback($script)
37
return $this;
38
}
39
40
+ /**
41
+ * Set drawCallback option value with Livewire integration.
42
+ * Solution as per issue https://github.com/yajra/laravel-datatables/issues/2401.
43
+ *
44
+ * @param mixed|null $script
45
+ * @return $this
46
+ * @see https://datatables.net/reference/option/drawCallback
47
+ */
48
+ public function drawCallbackWithLivewire($script = null)
49
+ {
50
+ $js = "function(settings) {
51
+ if (window.livewire) {
52
+ window.livewire.rescan();
53
+ }
54
+
55
+ $script
56
+ }";
57
58
+ $this->attributes['drawCallback'] = $js;
59
60
+ return $this;
61
62
63
/**
64
* Set footerCallback option value.
65
*
0 commit comments