Sending additional parameters in Server Side Processing
Sending additional parameters in Server Side Processing
Hi,
I am using data-tables and Server side processing.
However my Server side processing requires all request parameters should be sent in specific format to map the request variables properly
[code]
$('#example').dataTable(
{
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"bProcessing" : true,
"bServerSide" : true,
"fnServerParams": function ( aoData ) {
aoData.push( { "< portlet:namespace/>keyword":"test" , "keyword":"test"} );
},
"sAjaxSource" : "< %=dataresourceURL%>&< portlet:namespace/>sq=${sq}&< portlet:namespace/>sd=${sd}",
"sAjaxDataProp": "records",
"aoColumns": [
{ "mData": "attributes.entry.0.key" },
{ "mData": "attributes.entry.0.value" },
]
});
[/code]
the "sq" and "sd" parameters are coming fine to Servlet, however "keyword" is not coming as request parameter.
I just try to directly use the params to Source URL with '&' to show that these parameters are coming fine to backend.
I am using data-tables and Server side processing.
However my Server side processing requires all request parameters should be sent in specific format to map the request variables properly
[code]
$('#example').dataTable(
{
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"bProcessing" : true,
"bServerSide" : true,
"fnServerParams": function ( aoData ) {
aoData.push( { "< portlet:namespace/>keyword":"test" , "keyword":"test"} );
},
"sAjaxSource" : "< %=dataresourceURL%>&< portlet:namespace/>sq=${sq}&< portlet:namespace/>sd=${sd}",
"sAjaxDataProp": "records",
"aoColumns": [
{ "mData": "attributes.entry.0.key" },
{ "mData": "attributes.entry.0.value" },
]
});
[/code]
the "sq" and "sd" parameters are coming fine to Servlet, however "keyword" is not coming as request parameter.
I just try to directly use the params to Source URL with '&' to show that these parameters are coming fine to backend.
This discussion has been closed.
Replies
Allan