How to filter columns in jQuery DataTables?
How to filter columns in jQuery DataTables?
Filter rows in DataTables as follows:
[code]
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
if ( aData[3] == 'ru' )
{
return true;
}
return false;
}
);
[/code]
And here is how to filter the columns? For example I have columns ( http://jsfiddle.net/JLvWu/ ):
[code]
Date | City1 | City2 | City3 |
| Revenue | Costs | Revenue | Costs | Revenue | Costs |
[/code]
How to make so that when you filter by city there was only one city that is selected, and all other columns disappear? For example, if the user selected in the cities-filter City1, the table must be changed as follows:
[code]
Date | City1 |
| Revenue | Costs |
[/code]
[code]
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
if ( aData[3] == 'ru' )
{
return true;
}
return false;
}
);
[/code]
And here is how to filter the columns? For example I have columns ( http://jsfiddle.net/JLvWu/ ):
[code]
Date | City1 | City2 | City3 |
| Revenue | Costs | Revenue | Costs | Revenue | Costs |
[/code]
How to make so that when you filter by city there was only one city that is selected, and all other columns disappear? For example, if the user selected in the cities-filter City1, the table must be changed as follows:
[code]
Date | City1 |
| Revenue | Costs |
[/code]
This discussion has been closed.