search value for other than datatable columns
search value for other than datatable columns
giridhar
Posts: 20Questions: 4Answers: 0
Hi friends.i have a doubt.plz clarify me.iam using a datatable to display information from database.
for every column search,it is going to server and getting the values.i can i retrieve column values in the serverside using sSearch_0,sSearch_1 etc.these values are automatically going.
i want to add a checkbox .when i click on this checkbox the records should display according to this selected checkbox.for ex,clicked checkbox value is N.the records of status N should be displayed.This checkbox is not related to datatable.how can i take this value to the database and syncronize with datatables columns.how should i send this checkbox value along with sSearch_0,sSearch_1.
Help me if anybody know.
for every column search,it is going to server and getting the values.i can i retrieve column values in the serverside using sSearch_0,sSearch_1 etc.these values are automatically going.
i want to add a checkbox .when i click on this checkbox the records should display according to this selected checkbox.for ex,clicked checkbox value is N.the records of status N should be displayed.This checkbox is not related to datatable.how can i take this value to the database and syncronize with datatables columns.how should i send this checkbox value along with sSearch_0,sSearch_1.
Help me if anybody know.
This discussion has been closed.
Replies
see the reference documentation on http://datatables.net/ref
[quote]
It is often useful to send extra data to the server when making an Ajax request - for example custom filtering information, and this callback function makes it trivial to send extra information to the server. The passed in parameter is the data set that has been constructed by DataTables, and you can add to this or modify it as you require.
[/quote]
you can push the value of your checkbox onto the aoData array
[code]
$(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "status", "value": $('#my_secret_checkbox').val() } );
}
} );
} );
[/code]