Sending additional parameters in Server Side Processing

Sending additional parameters in Server Side Processing

nitin88nitin88 Posts: 6Questions: 0Answers: 0
edited December 2013 in General
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.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Please see the documentation for fnServerParams . You need to use name/value property pairs like in the example in the documentation.

    Allan
This discussion has been closed.