Date range inside loop of multiple datatable in the same page
Date range inside loop of multiple datatable in the same page
I came from the issue [https://datatables.net/forums/discussion/51949/looping-multiple-datatables-on-the-same-page#latest] and found a new one that comes from filtering of dates: if I filter and on change of this date range, it triggers table.draw()
but in console it triggers not defined
if it us inside of the loop of multiple datatable in the same page
Also, would like to know how to add ajax data without need to declare its columns (in my project, I have enough columns for the front end already declared and the ajax already structured)
Answers
Hi @gcc_andre ,
The problem here is to your other thread - you're reusing the same IDs for both tables. Here, you have two pairs of input elements which have the same ID in the DOM, which is illegal HTML - they have to be unique. Also, the search function is only using one set - it wouldn't know about the set for the other table.
Regarding Ajax, if you're passing objects, then it needs to be defined. You can however pass arrays as in this example here.
Cheers,
Colin
Got it, I've edited the link (http://live.datatables.net/magokusa/4/edit) till the point I could not advance:
table
was shared by both tables so it could not filter also so when it was executing.draw
, it tried to filter only the last table