Columns header displaying incorrect data, headers defined not matching what JSON data is returning
Columns header displaying incorrect data, headers defined not matching what JSON data is returning
thenewer
Posts: 11Questions: 0Answers: 0
I am trying the Datatables as my Subject is self explanatory what i am trying, the following is the code which is causing me a trouble!
$(document).ready(function() {
$('#eData').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "abc.php",
"sPaginationType": "full_numbers",
"aaSorting": [[1,'asc']],
"iDisplayStart": 0,
"sEcho":1,
"bLengthChange":false,
"aoColumns": [
{"sName": "projectid", "sTitle": ID", "sWidth": "10%", "bSortable": "true"},
{"sName": "name", "sTitle": "Name", "sWidth": "20%", "bSortable": "true"}
]
});
});
Now the Problem i get the JSOn response but the data returned does not match the headers i defined, it shows the data on rong columns, please correct me where this left out!
by theway very great Plugin
Awesome :)
$(document).ready(function() {
$('#eData').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "abc.php",
"sPaginationType": "full_numbers",
"aaSorting": [[1,'asc']],
"iDisplayStart": 0,
"sEcho":1,
"bLengthChange":false,
"aoColumns": [
{"sName": "projectid", "sTitle": ID", "sWidth": "10%", "bSortable": "true"},
{"sName": "name", "sTitle": "Name", "sWidth": "20%", "bSortable": "true"}
]
});
});
Now the Problem i get the JSOn response but the data returned does not match the headers i defined, it shows the data on rong columns, please correct me where this left out!
by theway very great Plugin
Awesome :)
This discussion has been closed.
Replies
duedate,pid,name,step
while i am viewing the data in my dataTables as:
PID, NAME, STEP, Due Date
So the data coming from JSON is not putting the correct column value under correct colum header, if you see, i am getting the result as
duedate,pid,name,step while i want to display on my screen as:
PID, NAME, STEP, Due Date and it should should exact data under the exact column but my whole data is scattered
i dumped my query in out put and it showed me like this:
select duedate,pid,name,step from stablename where 1=1 and duedate like %a% or pid like %a% or name like %a% or step like %a% order by name asc
I don't know any coldfusion, so I can't advise you myself.