Custom sorting function with Vue3 component
Custom sorting function with Vue3 component
Link to test case: https://codesandbox.io/s/datatables-option-api-example-with-sorting-ce8i5z?file=/src/App.vue
Debugger code (debug.datatables.net): DataTables debugger: jQuery not loaded on this page, therefore no DataTables :-(
Error messages shown: fn.dataTable.absoluteOrderNumber is not a function
Description of problem:
Hi, I would like to load absolute sorting when using DataTable Vue3 component.
I don't know how to access $.fn.dataTable.
I tried to load first jquery then sorting plugin as shown in the code sandbox example, but I cannot access absoluteOrderNumber function.
How should I do this ?
Best regards
This question has an accepted answers - jump to answer
Answers
Hi,
The Absolutely sorting plug-in (and the others in general in fact) do not currently support module loading - they are UMD loaders. I'll update them to support ESM loading - thanks for pointing that out.
In the mean time, you would need to copy the code from the plug-in into your own local file and use it from there. I've forked your example and updated it with that here: https://codesandbox.io/s/datatables-option-api-example-with-sorting-forked-pwkgm0?file=/src/App.vue .
Allan
Many thanks Allan.
That's a tip I can absolutely do !
Best regards !