Min-Max filtering in column header
Min-Max filtering in column header
Background: I want to create min/max filters in the THEAD of the table. I am using server-side processing. On the server-side I have written generic code to apply filters to strings and numeric fields (numeric fields require min and max). Plugins I am using are ColReorder, ColVis, FixedColumns, FixedHeader.
Scenario: Say I have a table with 2 columns, the first column is numeric and the second is text. If I add a min and a max textbox to the header, a new sSearch_x parameter is created for min and max, and then a third for the second column text filter.
The issue is my generic code doesn't know that column 1 has 2 sSearch parameters. I can't determine based on the information sent back which sSearch's go with which column. Is there a way to associate the sSearch parameter to the column it belongs to?
Thanks!
Darrell
Scenario: Say I have a table with 2 columns, the first column is numeric and the second is text. If I add a min and a max textbox to the header, a new sSearch_x parameter is created for min and max, and then a third for the second column text filter.
The issue is my generic code doesn't know that column 1 has 2 sSearch parameters. I can't determine based on the information sent back which sSearch's go with which column. Is there a way to associate the sSearch parameter to the column it belongs to?
Thanks!
Darrell
This discussion has been closed.
Replies
If you are sending multiple fields for each column filter, you will either need to combine the two fields together into one and then split it on the server, or pass a custom parameter: http://datatables.net/examples/server_side/custom_vars.html .
So that should be half the problem :-) The other half will be with ColReorder and which column sSearch_{i} is actually meaning. To do this, you can use sName, like this:
http://datatables.net/release-datatables/extras/ColReorder/server_side.html
https://github.com/DataTables/DataTables/blob/master/examples/examples_support/server_processing_ordering.php
Regards,
Allan
How would I combine the fields together, using jQuery I assume? What would the code look like?
Thanks!