filtering individual columns using select menus

filtering individual columns using select menus

sunoraclesunoracle Posts: 2Questions: 0Answers: 0
edited October 2010 in General
I am using the DataTables individual column filtering example (using select menus).

the below code adds select menu filter for all the columns,how do i modify the code to display few select menu filters (say only 3 filters out of the 5 columns.)
[code]
/* Add a select menu for each TH element in the table footer */
$("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );
[/code]

to be more specific i modified the code as below:to enable filter only on cols 0,1,4 & 5
This disables the filter but shows the cols 2 & 3 select menus, is there a way where i cannot see the selectmenus for columns 2 & 3
[code]
/* Initialise the DataTable */
var oTable = $('#example').dataTable( {
//"oLanguage": {
//"sSearch": "Search all columns:"
//}
"aoColumns": [
{ "bFilter": [0] },
{ "bFilter": [1] },
{ "bFilter": [4] },
{ "bFilter": [5] },
],
"aaSorting": [[0, 'asc']]
} );
[/code]

Replies

  • heiterheiter Posts: 10Questions: 0Answers: 0
    I have excatly the same problem. Would appriciate any help.

    btw datatables is an amazing plugin, superb job!
  • heiterheiter Posts: 10Questions: 0Answers: 0
    For now i set on the footer th's "visibility:hidden;", that I dont want to have.
    But it would be more ideal not to have them in the first place.
  • sunoraclesunoracle Posts: 2Questions: 0Answers: 0
    that works for now,Thanks for your input.
    Datatables is an amazing plugin with lot of functionality and implementations.
    Appreciate the amazing work.
This discussion has been closed.