Using fnFilter with sAjaxSource?

Using fnFilter with sAjaxSource?

shortkudshortkud Posts: 2Questions: 0Answers: 0
edited March 2012 in General
I'm trying to use fnFilter to filter a column and also use sAjaxSource. A discussion page I came across (can't seem to find it now) says that sAjaxSource by default sets bFilter to false and I'm guessing that is why I am having issues?

If I try to use fnFilter with the code below I get the error:

[quote]Uncaught TypeError: Cannot read property 'oFeatures' of null[/quote]

[code]
$(document).ready(function(){
var oTable = $('#datables').dataTable();
$('#datatables').dataTable({
"bJQueryUI": true,
"sPaginationType":"full_numbers",
"iDisplayLength":50,
"bFilter": true,
"sAjaxSource": "json.php",
"bProcessing": true,
"bServerSide": true,
});
oTable.fnFilter('string',3)
})
[/code]

I am using the example server side processing script here: http://datatables.net/examples/data_sources/server_side.html

Do I need to be using fnServerData in combination with sAjaxSource in order to use fnFilter? I'd appreciate any help.

Thanks!

Replies

  • shortkudshortkud Posts: 2Questions: 0Answers: 0
    With the help of a friend I fixed my issue with the following script.

    [code]
    $(document).ready(function(){
    var oTable = $('#datatables').dataTable({
    "bJQueryUI": true,
    "sPaginationType":"full_numbers",
    "iDisplayLength":50,
    "bFilter": true,
    "sAjaxSource": "json.php",
    "bProcessing": true,
    "bServerSide": true,
    });
    oTable.fnFilter('string',3)
    })
    [/code]
This discussion has been closed.