How do I use a plugin?
How do I use a plugin?
ioup
Posts: 4Questions: 2Answers: 0
Hi I'm new around here and it's the first time I use datatables.
I want to use the date range plugin but I don't really know how to do it.
If someone could explain it to me that would be great because I found the info in here https://datatables.net/plug-ins/filtering/row-based/range_dates not that explicit.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
All you have to do is load the JS/CSS files for the plugin, and the DataTables JS/CSS as well.. Then it depends how the plugin is initiated. usually DT plugins are initiated by adding some settings to the
$().DataTable({ /* CONFIG.. */ })
config..For the one you linked, it looks like you just need to add event listeners..
Its right there in the Example on the page you linked
jLinux this is the script I have for the DT:
and this is my table:
I made the imports and it shows the inputs to choose a date but it doesn't do anything more other than it already did. As I choose a date nothing is filtered in the table.
What I'm doing wrong?
You don't have any filtering logic - you've got two calendars and a DataTable, but the know nothing about each other. You'd need some custom filtering logic like in the example you linked to above.
See also the custom search plug-in documentation.
Allan