Problem with parsing parametres - server side
Problem with parsing parametres - server side
Hello there,
I am dealing with an issue, that I am not able to parse incoming parameters from DataTable on the server.
var table = AJS.$(this.tableElement).DataTable({
bPaginate: true,
bProcessing: true,
bDeferRender: true,
bServerSide: true,
ajax: {
url: AJS.contextPath() + this.serverSidePath,
type: 'POST'
},
bStateSave: saveable,
bSort: sortable,
aoColumns: [
{ "data": "name" },
{ "data": "milestone" },
{ "data": "customer" },
],
sDom: "ilrtp",
});
With the simple parameters it is ok, eg. draw, start and legth I get properly. But for "search" parameter only thing I get is "[object Object]". For "columns" parameter I get "[object Object] [object Object] [object Object]". I sniffed the packets from data table and the problem is already on javascript.
http://10.156.9.142/example/server_side/scripts/server_processing.php?draw=1&columns=%5Bobject+Object%5D&columns=%5Bobject+Object%5D&columns=%5Bobject+Object%5D&order=%5Bobject+Object%5D&start=0&length=10&search=%5Bobject+Object%5D&_=1418208644787
I checked the DataTables source code and in function _fnBuildAjax() where the ajax is created the variable baseAjax has parameter data, where the javascript object is assigned. Should not be there something like JSON stringify()? Or something simmilar.
Any ideas? Am I doing something wrong?
Answers
Ok, so if somebody had a similar problem. I think it usually does not happen, however I am working on JIRA plugins and may be this issue is caused by some Atlassian changes in javascript. I dont know why that happens, but I wrote function that parses general "data" object into url parameters based on DataTables documentation. It can be put into DataTables source code...