How is everyone getting fnServerParams to work???

How is everyone getting fnServerParams to work???

studio6000studio6000 Posts: 7Questions: 0Answers: 0
edited December 2011 in General
I have copied the code exactly as shown in Examples page and it is still not working for me. What am I doing wrong?

I am using latest versions as am getting js and css files from datatables.net.

My example can be seen here: http://customizepmd.com/pmd135/server_side.php

This is my code:


$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "location_id", "value": "23" } );
}
} );
} );


As you can see I want the results to only show the records with a location_id of 23. It is showing all of them.

Please, please help! I have been trying to figure this out for months now.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Looks like it is working just fine to me on your site - looking at the XHR with Inspector:

    [quote]
    sEcho:1
    iColumns:5
    ...
    title:Bay
    [/quote]

    which corresponds to the code our your page:

    [code]
    aoData.push( { "name": "title", "value": "Bay" } );
    [/code]

    Allan
This discussion has been closed.