Select value updating datatable but not dropdown, cannot select "All"
Select value updating datatable but not dropdown, cannot select "All"
Hi there,
I am trying to add multiple dropdown searches to my datatables, which pull in data from Google Sheets. The dropdowns work, in that they update the table, however the option value in the select button does not update, and only displays the default "All" category. Selecting "All" also does not remove the filter, so I cannot retrieve the original datatable view.
If I remove the "escapeRegex" option, the values do update when a new selection is made, but then the datatable itself does not update. Any way of working out what is the problem? Haven't found anything about this in the forum.
Link to test case: http://live.datatables.net/zonacaku/1/edit?html,js,output
Thanks
This question has accepted answers - jump to:
Answers
Allan posted an example in this thread of creating a cascading option filter. I think its what you are looking for.
Kevin
Thank you, Kevin
This resolves the issue. I am trying to stick the option filters for the first two columns in a separate container outside the table, however I can only return 1 of the columns.
I have tried writing an array and selecting the indexes ie:
But this only returns the 2nd column
My guess is your selector is not changing fo each column so the first overwrites the second. Please update your test case to show what you are doing if you need further help.
Kevin
Thanks for the prompt response.
I have updated the test case: http://live.datatables.net/zonacaku/2/edit?html,js,output
It looks like you're right, in that the first is overwritten by the second, but not sure why...
This is likely the problem. You will want to create an individual element for each select input and use the
id
instead of the class. You could use the column index as part of theid
by usingcolumn().index()
.Kevin
Thanks Kevin, that fixed the problem!