Individual column filtering with data from array doesn't work
Individual column filtering with data from array doesn't work
Hello,
I'm trying to get individual column filtering working on a table that uses an array as data.
This is my code
$('#table').DataTable( {
"lengthMenu": [10, 25, 50, "All"],
responsive: true,
dom: 'Blfrtip',
buttons: [],
data: range.values, // this is the array with data
columns: [
{ title: header[0] },
{ title: header[1] },
{ title: header[2] },
{ title: header[3] },
{ title: header[4] },
{ title: header[5] },
{ title: header[6] }
]
} );
I've tried this
https://www.jqueryscript.net/demo/DataTables-Jquery-Table-Plugin/examples/api/multi_filter_select.html
Nothing works, can anyone help?
Answers
Can you be more specific and describe the actual problem?
You are not showing any of the code for this.
Maybe you can post a test case with an example of what would be in the
header
andrange.values
variables. This way we have your specific information to help.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
The header is an array with the table headings.
And the range.values is a 2d array with the table contents
The table works with this code, the problem is that the filtering for individual columns doesn't work
Hi @davedave9 ,
Your code, that you posted above, doesn't construct a dropdown like the page you linked to, nor does it attempt to do any searching. That example you posted is a good one, so I'd suggest using that as a template.
If still no joy, we're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin