individual column filtering example issue
individual column filtering example issue
In the example on : http://www.datatables.net/examples/api/multi_filter_select.html
It states that this part needs to be there:
[code] $("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );[/code]
However, my source is from ajax. So i would see my select boxes but no data is in there.
I fixed this by adding the entry with the fnInitComplete:
[code] "fnInitComplete" : function(){
/* 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]
But now my select boxes are filled but i cannot click anywhere in my datatables. Selecting something from the dropdown also does not change my view.
So i know i am close, but i am missing something. Why cant i interact with it anymore?
Using an ajax as my source btw. The data is correct and working without the filtering.
Thanks for any help.
It states that this part needs to be there:
[code] $("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );[/code]
However, my source is from ajax. So i would see my select boxes but no data is in there.
I fixed this by adding the entry with the fnInitComplete:
[code] "fnInitComplete" : function(){
/* 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]
But now my select boxes are filled but i cannot click anywhere in my datatables. Selecting something from the dropdown also does not change my view.
So i know i am close, but i am missing something. Why cant i interact with it anymore?
Using an ajax as my source btw. The data is correct and working without the filtering.
Thanks for any help.
This discussion has been closed.
Replies
Allan