1:1 Filtering - select combo box' value == DataTable field value?
1:1 Filtering - select combo box' value == DataTable field value?
Hello everyone,
my DataTable contains a column with the words "active" and "inactive". I got a select combo box with both of these values for filtering the content.
It's showing rows with "inactive" when "active" is selected, because - logically - it's in the word.
[code]
$('#status').change(function() {
var choice = $('#status').val();
oTable.fnFilter( choice, 3 );
});
[/code]
Is there any way I can say the text has to be identical 1:1?
Thanks in advance.
Douglas
my DataTable contains a column with the words "active" and "inactive". I got a select combo box with both of these values for filtering the content.
It's showing rows with "inactive" when "active" is selected, because - logically - it's in the word.
[code]
$('#status').change(function() {
var choice = $('#status').val();
oTable.fnFilter( choice, 3 );
});
[/code]
Is there any way I can say the text has to be identical 1:1?
Thanks in advance.
Douglas
This discussion has been closed.
Replies
It looks like you must create your own filter. Try look at this sample
http://datatables.net/1.5-beta/examples/api/range_filtering.html
I tried to do this, but it doesn't seem to work:
[code]$('#status').change( function( oSettings, aData, iDataIndex ) {
var choice= $('#status').val();
if ( aData[3] == choice)
{
return true;
}
return false;
});[/code]
[code]
oTable.fnFilter( '^Active' , 3 , true )
oTable.fnFilter( '^Inactive' , 3 , true )
[/code]
Are the two methods I used.