Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
97
rated 0 times [  98] [ 1]  / answers: 1 / hits: 15601  / 8 Years ago, tue, april 19, 2016, 12:00:00

I have a datatable which is being populated and displayed as I wish. There is a date column that I could like to apply a date range filter to. There are two controls on my HTML page that I have given id's to and added the datepicker jquery to . I've looked at the code example given here https://datatables.net/plug-ins/filtering/row-based/range_dates but when I run the code a and change the date on the control I see an error that oTable.draw() is not a function.



I'm using datatables 1.10.11 and I've set my table up using the following code



var statementTable = $('#statementTable').DataTable({....});


The on change event is being trigger with this line



$('#startdatepicker').change(function () { statementTable.fnDraw(); });


When this line executes I see the error in the console:




statementTable.fnDraw() is not a function.




Can anyone offer any pointers please?
Thanks
Richard


More From » jquery

 Answers
12

This was caused by the declaration of the statementTable being in the wrong place so not available to the wider context. See the comments below the original post.


[#62487] Sunday, April 17, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
willieelisham

Total Points: 201
Total Questions: 108
Total Answers: 106

Location: Zambia
Member since Sat, Oct 31, 2020
4 Years ago
;