How to add default fnServerParams ?
How to add default fnServerParams ?
Hi Guys!
How can i add some default server params?
The code below add server params but is not for every call:
[code]
$(document).ready(function(){
$("#teste").dataTable({
"aoColumns" : [
{ "sTitle": "Id", "mDataProp": "id", "bSortable" : false, "bVisible": false },
{ "sTitle": "Nome", "mDataProp": "nome", "bSortable" : false },
{ "sTitle": "E-mail", "mDataProp": "email", "bSortable" : false }
],
"bServerSide": true,
"sAjaxSource": '/usuarios/paginar',
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "pageRequest", "value": "test" } );
}
});
});
[/code]
i tried this code but does not work:
[code]
$.fn.dataTableExt.oApi.fnServerParams = function ( aoData )
{
aoData.push( { "name": "pageRequest", "value": "test" } );
}
[/code]
Thanks!!!
How can i add some default server params?
The code below add server params but is not for every call:
[code]
$(document).ready(function(){
$("#teste").dataTable({
"aoColumns" : [
{ "sTitle": "Id", "mDataProp": "id", "bSortable" : false, "bVisible": false },
{ "sTitle": "Nome", "mDataProp": "nome", "bSortable" : false },
{ "sTitle": "E-mail", "mDataProp": "email", "bSortable" : false }
],
"bServerSide": true,
"sAjaxSource": '/usuarios/paginar',
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "pageRequest", "value": "test" } );
}
});
});
[/code]
i tried this code but does not work:
[code]
$.fn.dataTableExt.oApi.fnServerParams = function ( aoData )
{
aoData.push( { "name": "pageRequest", "value": "test" } );
}
[/code]
Thanks!!!
This discussion has been closed.
Replies
Allan