Custom filtering - range search without jquery
Custom filtering - range search without jquery
zehgeh
Posts: 7Questions: 2Answers: 0
Hi, I have datatables (1.12.1) without jquery and everything works except my custom filtering. Does the function exist without jquery? https://datatables.net/examples/plug-ins/range_filtering.html
I do not know how to address the function since $.fn. does not exist anymore.
Thanks for the help.
Best Christoph
$.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
...
Replies
DataTable.ext.search
is the object to use.$.fn.DataTable
is basically the same as the globalDataTable
.Allan
Thanks allan, but if I do that, I won't get anything back. No error or console output.
I have created an example: http://live.datatables.net/capabofi/26/edit
If jquery is loaded, the example also works. If I remove jquery, the filter no longer works.
According to the Manual Datatables requires jQuery:
Possibly your import includes jQuery. Datatalbes itself won't initialize if you remove jquery.js from the test case you posted.
Are you saying you don't see any rows, are they all filtered?
Or do you mean that you aren't seeing the output of
console.log(searchData, 'searchData')
?Are you initializing the search plugin before or after initializing Datatables. Are you doing something to trigger the plugin to run like calling
draw()
to draw the table?Better than answering these questions is to provide a link to your page or a test case replicating the problem so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
The current release of DataTables doesn't work with ESModules - are you using something to convert your
import
statement into arequire
? I think a minimal repo showing the issue might be the best option here to provide a test case.DataTables 1.13 which will drop next week, will include support for ESModules.
Allan