question re:using an external form to access datatables
question re:using an external form to access datatables
GWerner
Posts: 7Questions: 0Answers: 0
I have an external search form that I would like to use to update the content of the datatable that is using server-side processing.
html
[code][/code]
if I add the following function ... I am able to access the global search field
[code]
$('#myField').keyup(function(){
oTable.fnFilter( $(this).val() );
} );
[/code]
however, I do not simply want to filter all the results. What I would like, is to be able to pass a value to the server side processing script. from other questions, it looks like I need to add the following:
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
var testVal = $('#myField').val();
aoData.push( { "name": "test", "value": testVal } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
} );
}
[/code]
however ... when I do this ... all that gets passed to the server script is &test=
am I doing something wrong? did I miss a step?
Thanx
html
[code][/code]
if I add the following function ... I am able to access the global search field
[code]
$('#myField').keyup(function(){
oTable.fnFilter( $(this).val() );
} );
[/code]
however, I do not simply want to filter all the results. What I would like, is to be able to pass a value to the server side processing script. from other questions, it looks like I need to add the following:
[code]
"fnServerData": function ( sSource, aoData, fnCallback ) {
/* Add some extra data to the sender */
var testVal = $('#myField').val();
aoData.push( { "name": "test", "value": testVal } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
} );
}
[/code]
however ... when I do this ... all that gets passed to the server script is &test=
am I doing something wrong? did I miss a step?
Thanx
This discussion has been closed.
Replies
Allan
As for your comment ... why is fnServerParams better to use than fnServerData? just curious.
Allan