I am able to successfully load DataTables on my element with Vite, however the rowgroup plugin is not loading. How do I do this?
import jQuery from 'jquery';
Object.assign(window, {
$: jQuery,
jQuery
})
import DataTable from 'datatables.net';
import 'datatables.net-rowgroup';
DataTable($);
let table = $("table").DataTable(options);
The error I receive is
table.rowGroup is not a function
Here is an answer to make plugin work.
import jQuery from "jquery";
import $ from "jquery";
import DataTable from "datatables.net";
DataTable(window, $);
import RowGroup from "datatables.net-rowgroup/js/dataTables.rowGroup.min.js";
RowGroup(window, $);
Look at also my complete answer https://stackoverflow.com/a/74039112/10489562 to use datatable.net with Vite.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With