Using values from date filter in exported excel file
Using values from date filter in exported excel file
I am using datatables to generate an excel file. The datatable uses the date range filter (https://datatables.net/extensions/datetime/examples/integration/datatables.html) to specify a date range, and I would like to display the values of the date range in my exported excel file.
I have tried to use the messageTop
attribute to display these values in the exported excel file using $(#startDateInputId).val()
and $(#endDateInputId).val()
but in the excel file the values are null.
How do I properly access these date values from the date range filter and display them in the exported excel file?
This question has an accepted answers - jump to answer
Answers
Are you using messageTop as a function like this example?
Please provide a link to a test case showing what you are doing so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
@kthorngren No I am not using messageTop as a function like that example, is that what I need to be doing?
Here is the link to the test case let me know if it works for you I have never used this before http://live.datatables.net/xivexure/1/edit
Yes you need to use a function. Otherwise you are statically defining the messageTop when the button is initialized. The function will run each time the button is clicked. Here is the updated example:
http://live.datatables.net/xivexure/2/edit
When using the live.datatables.net environment you need to add any extensions, like the buttons, you are using. I used the Download builder to generate the needed files.
Kevin
@kthorngren ah okay that works now, thank you so much I appreciate it.