Can't get the fnFilter working, everything else works

Can't get the fnFilter working, everything else works

Niller2000Niller2000 Posts: 3Questions: 0Answers: 0
edited December 2010 in General
Hi,

I tried to get this awesome script working for a website of mine, but I have some issues. Everything works until I try to filter using the fnFilter.

Here is the code I tried to get working...

Javascript:
[code]


function fnFilterColumn ( i, inputTypen )
{
$('#example').dataTable().fnFilter(
$("#"+inputTypen).val(),
i
);
}

$(document).ready(function() {
/* Initialise datatables */
$('#example').dataTable({
"bJQueryUI": true,
"bFilter": false,
"bLengthChange": false,
"bStateSave": true,
"sPaginationType": "full_numbers"
});

$("#postnr").keyup( function() { fnFilterColumn( 3, "postnr" );} );

$("#bolig").click(function(){
if ($("#bolig").is(":checked")) {
oTable.fnFilter("1092");
alert('Bolig aktiv');
} else {
oTable.fnFilter("");
alert('Bolig deaktiveret');
}
});

$("#kontor").click(function(){
if ($("#kontor").is(":checked")) {
oTable.fnFilter("1094");
alert('Kontor aktiv');
} else {
oTable.fnFilter("");
alert('Kontor deaktiveret');
}
});

});

[/code]

and here is the input area I try to get working with filtering

html:
[code]


BY/POSTNUMMER:

MINIMUM M2:



LEJEPRIS FRA:

LEJEPRIS TIL:




BOLIG KONTOR



[/code]

Why is it that the fnFilter ignores me completely?

Kind regards,
Niels

Replies

  • Niller2000Niller2000 Posts: 3Questions: 0Answers: 0
    Found the problem, missed the bFilter. It was set to false.
This discussion has been closed.