How do I send a FORM value to the Server Processing file?
How do I send a FORM value to the Server Processing file?
Hi,
I want to send a custom value to the server_processing.php file to change the SQL with a form.
Is this possible? And how can I do this.
http://www.datatables.net/examples/server_side/custom_vars.html ?
Thanks,
Blalien
[code]
$(document).ready(function() {
oTable = $('#tableDM').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"sPaginationType": "full_numbers",
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
var this_class = "no_change";
if ( aData[0] == "<?php echo $jump;?>" )
{
this_class = "changed";
}
nRow.className = nRow.className + " " + this_class;
return nRow;
},
"sAjaxSource": "includes/server_processing_dm.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
aoData.push( { "test": "22"} );
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
} );
},
"oLanguage": {
"sSearch": "Zoek in alle kolommen:",
"sLengthMenu": "Toon _MENU_ resultaten per pagina",
"sZeroRecords": "Geen resulaten gevonden.",
"sInfo": "Toon _START_ tot _END_ van _TOTAL_ resultaten",
"sInfoEmtpy": "Toon 0 tot 0 van 0 resultaten",
"sInfoFiltered": "(gefilterd uit _MAX_ resultaten)",
"oPaginate": {
"sFirst": "Begin",
"sLast": "Eind",
"sNext": "Volgende",
"sPrevious": "Vorige"
}
},
"aoColumns": [
{ "sClass": "center", "bSortable": false },
{ "bSearchable": false, "bVisible": false, "sWidth": "auto" },
{ "sWidth": "5%" },
{ "sWidth": "50%" },
{ "sWidth": "5%" },
{ "sWidth": "5%" },
{"bSearchable": false, "bSortable": false, "sWidth": "5%", "sClass": "center" },
{"bSearchable": false, "bSortable": false, "sWidth": "5%", "sClass": "center" },
{ "bSearchable": false, "bVisible": false, "sWidth": "auto" }
],
"aaSorting": [[1, 'asc']],
"fnDrawCallback": fnOpenClose
} );
} );
[/code]
I want to send a custom value to the server_processing.php file to change the SQL with a form.
Is this possible? And how can I do this.
http://www.datatables.net/examples/server_side/custom_vars.html ?
Thanks,
Blalien
[code]
$(document).ready(function() {
oTable = $('#tableDM').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"sPaginationType": "full_numbers",
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
var this_class = "no_change";
if ( aData[0] == "<?php echo $jump;?>" )
{
this_class = "changed";
}
nRow.className = nRow.className + " " + this_class;
return nRow;
},
"sAjaxSource": "includes/server_processing_dm.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
aoData.push( { "test": "22"} );
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
} );
},
"oLanguage": {
"sSearch": "Zoek in alle kolommen:",
"sLengthMenu": "Toon _MENU_ resultaten per pagina",
"sZeroRecords": "Geen resulaten gevonden.",
"sInfo": "Toon _START_ tot _END_ van _TOTAL_ resultaten",
"sInfoEmtpy": "Toon 0 tot 0 van 0 resultaten",
"sInfoFiltered": "(gefilterd uit _MAX_ resultaten)",
"oPaginate": {
"sFirst": "Begin",
"sLast": "Eind",
"sNext": "Volgende",
"sPrevious": "Vorige"
}
},
"aoColumns": [
{ "sClass": "center", "bSortable": false },
{ "bSearchable": false, "bVisible": false, "sWidth": "auto" },
{ "sWidth": "5%" },
{ "sWidth": "50%" },
{ "sWidth": "5%" },
{ "sWidth": "5%" },
{"bSearchable": false, "bSortable": false, "sWidth": "5%", "sClass": "center" },
{"bSearchable": false, "bSortable": false, "sWidth": "5%", "sClass": "center" },
{ "bSearchable": false, "bVisible": false, "sWidth": "auto" }
],
"aaSorting": [[1, 'asc']],
"fnDrawCallback": fnOpenClose
} );
} );
[/code]
This discussion has been closed.
Replies
Thanks,
Blalien
You've already linked to the example that I would have done :-). Yes that is the correct way to go. Does it not work for you?
Allan