I was hoping someone could help me. I went crazy with that.
I have a situation where I load the DataTables grid (a wonderful thing by the way!), And everything is fine. Then I go looking, and I have problems. The data that the grid fills comes from two different database tables (this is good), but when someone searches, I have no way of knowing where to go and get the data. I need to know what criteria a search refers to (i.e. Name or contact). I see that when a search is called from the server using the default search box, there are variables like "sSearch_0" that are not set, how to set them?
Here is the table initialization code:
oTable = $('#example').dataTable({ "bJQueryUI": true, "bFilter": true, "sPaginationType": "full_numbers", "bPaginate " : true, "bServerSide" : true, "sAjaxSource" : "php/tabledata.php", "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0,6,8 ] }, { "sClass": "tdCenter", "aTargets": [ 0,1,2,3,4,5,6,7,8 ] } ], "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( { "name": "userid", "value": userid } ); $.getJSON( sSource, aoData, function (json) { fnCallback(json) }); }
});
I examined the options for adding data to "fnServerData" and actually used it for the first call to the initialization server, but I donβt know how to use this for the subsequent call to the server. I tried using "fnFilter", but I canβt see what server call is doing for more data. At the moment, I see no other way to make a server call, except for the default search box, and I see how to find out which column the search is in.
Can someone help me here and point me in the right direction?