Multiple filters in a single column. Not all filter fields posting to ajax source.

Multiple filters in a single column. Not all filter fields posting to ajax source.

dkantaladkantala Posts: 1Questions: 0Answers: 0
edited November 2011 in Bug reports
Version: 1.7.6
Using Ajax data source

I turned off (hide) global filtering and instead have a filter box in each column. For my date columns, I added two filter fields from and to. DataTables is posting sSearch data for the number of columns, not the number of actual filter fields.

In this particular case I have 16 columns with 19 filter fields

My fix was to add the following code to the datatable initialization for the missing filters.

aoData.push( { "name": "sSearch_17", "value": cleanFilter($('#search_17').val()) } );
aoData.push( { "name": "sSearch_18", "value": cleanFilter($('#search_18').val()) } );
aoData.push( { "name": "sSearch_19", "value": cleanFilter($('#search_19').val()) } );

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    This isn't really a bug as DataTables is operating as designed and documented in this case ( http://datatables.net/usage/server-side ). Each column can have an individual filter applied to it - DataTables doesn't know anything about the INPUT elements (or SELECT or whatever) that are being used to drive the filter, but each filter can have an individual filter, and there is the global filter. Hence way you are seeing the effect that you are.

    Allan
This discussion has been closed.