File tree Expand file tree Collapse file tree 1 file changed +28
-24
lines changed
Expand file tree Collapse file tree 1 file changed +28
-24
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,31 @@ class LivewireDatatable extends Component
115115 'does not include ' => '<> ' ,
116116 ];
117117
118+ protected $ viewColumns = [
119+ 'index ' ,
120+ 'hidden ' ,
121+ 'label ' ,
122+ 'tooltip ' ,
123+ 'group ' ,
124+ 'summary ' ,
125+ 'content ' ,
126+ 'headerAlign ' ,
127+ 'contentAlign ' ,
128+ 'type ' ,
129+ 'filterable ' ,
130+ 'hideable ' ,
131+ 'sortable ' ,
132+ 'complex ' ,
133+ 'filterView ' ,
134+ 'name ' ,
135+ 'params ' ,
136+ 'wrappable ' ,
137+ 'width ' ,
138+ 'minWidth ' ,
139+ 'maxWidth ' ,
140+ 'preventExport ' ,
141+ ];
142+
118143 /**
119144 * This events allows to control the options of the datatable from foreign livewire components
120145 * by using $emit.
@@ -273,30 +298,9 @@ public function columns()
273298 public function getViewColumns ()
274299 {
275300 return collect ($ this ->freshColumns )->map (function ($ column ) {
276- return collect ($ column )->only ([
277- 'index ' ,
278- 'hidden ' ,
279- 'label ' ,
280- 'tooltip ' ,
281- 'group ' ,
282- 'summary ' ,
283- 'content ' ,
284- 'headerAlign ' ,
285- 'contentAlign ' ,
286- 'type ' ,
287- 'filterable ' ,
288- 'hideable ' ,
289- 'sortable ' ,
290- 'complex ' ,
291- 'filterView ' ,
292- 'name ' ,
293- 'params ' ,
294- 'wrappable ' ,
295- 'width ' ,
296- 'minWidth ' ,
297- 'maxWidth ' ,
298- 'preventExport ' ,
299- ])->toArray ();
301+ return collect ($ column )
302+ ->only ($ this ->viewColumns )
303+ ->toArray ();
300304 })->toArray ();
301305 }
302306
You can’t perform that action at this time.
0 commit comments