Min-Max filtering in column header

Min-Max filtering in column header

dnortondnorton Posts: 6Questions: 1Answers: 0
edited November 2010 in General
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

Replies

  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    edited November 2010
    Hi Darrell,

    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
  • dnortondnorton Posts: 6Questions: 1Answers: 0
    Ok, I have the server-side part with ColReorder figured out for the min/max and sorting.

    How would I combine the fields together, using jQuery I assume? What would the code look like?

    Thanks!
  • dnortondnorton Posts: 6Questions: 1Answers: 0
    bump
This discussion has been closed.