niiknow / vue-datatables-net

Vue jQuery DataTables.net wrapper component
https://niiknow.github.io/vue-datatables-net/
MIT License
171 stars 58 forks source link

DataTables variable #25

Closed pututbawono closed 4 years ago

pututbawono commented 4 years ago

Hi, In jQuery, I usually use DataTables by instantiating a window variable for the table, like so :

var window.dataTable = $('#table').Datatable({ });

I do this because there is a global function in my app that use this window variable for table re-draw. So, using your wrapper, how can I achieve this? I've search your docs but haven't found any explanation. Thanks.

noogen commented 4 years ago

The component also expose a dataTable property - https://github.com/niiknow/vue-datatables-net/blob/master/src/VdtnetTable.vue#L151 You can access it with ref="table" as in example - https://github.com/niiknow/laratt-api/blob/5f63e72dd4087d199c64a12f3343a52a28421ad7/resources/js/components/DataTableNet.vue#L181

pututbawono commented 4 years ago

Yes, I tried it and it works in my app. Actually I have another question, but I'll open another issue, for the sake of sistematics :). Thank you sir.