custom searching for a date range, with multiple fields and multiple tables
custom searching for a date range, with multiple fields and multiple tables
unfortunately, I don't have a test case that I can link right now (I'll see if I can put one together)
I'm using datatables on a plethora of pages, often multiple per page. I'm doing the column based filtering, which works fine for most types of fields but for dates, it would be really handy to be able to add date range filtering instead of a single text matching filter.
some of my pages are working server side, so I can handle that with the existing column filtering with a specific server side fix to handle min:11/22/2001;max:11/22/2001
other page are working client side (with data populated via velocity template), so
I've looked at a couple of examples:
https://datatables.net/forums/discussion/41003/fn-datatable-ext-search-push
https://datatables.net/manual/plug-ins/search
I have most of these pages set up to use session state, which works great with column filtering. But the above examples look like they're global and don't seem to apply to queries sent via col.search( searchVal ).draw();
can I override the column filtering for a specific table so that if the data comes in with a min and max values, I can apply date filtering to it inside of that range? If so, any suggestions for where to start fiddling with that?
Answers
Maybe you can make use of this date range search plugin:
https://datatables.net/plug-ins/filtering/row-based/range_dates
Also this range search example might help.
Kevin
Also if you have multiple tables on the same page you can use the technique from this thread to distinguish between the tables within the search plugin.
Kevin