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.
![dkantala](https://secure.gravatar.com/avatar/13460d6fa4077b8b3e5c3cbbf3b3f325/?default=https%3A%2F%2Fvanillicon.com%2F13460d6fa4077b8b3e5c3cbbf3b3f325_200.png&rating=g&size=120)
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()) } );
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()) } );
This discussion has been closed.
Replies
Allan