Problem with migration to v1.9.4
Problem with migration to v1.9.4
bubuzzz
Posts: 26Questions: 0Answers: 0
We used v1.8.1 for our old project. Now we are trying to migrate to 1.9.4. At this moment, we use twitter bootstrap 2.1, jquery 1.8.2 with datatable 1.9.2 but we still get errors.
Here is our code
HTML
[code]
User name
Source
DN(s)
[/code]
Javascript
[code]
$(document).ready(function() {
$("#tblUser").dataTable({
"bProcessing": true,
"bSort" : false,
"bServerSide": true,
"sAjaxSource": "${ctx}/jsp/struts/resource/fseuser/fseuser.do?method=generalUserList",
"aoColumnDefs": [
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 0 ]
},
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 1 ]
},
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 2 ]
}
]
});
});
[/code]
And this is our responded data:
[code]
{"sEcho":0,"iTotalRecords":"10","iTotalDisplayRecords":"27","aaData":[{"acpId":"","acps":[],"certificate":[],"createDate":"2012-10-24 11:33:49","createUserKey":"","desc":"","descHtml":"","displayName":"cly4" .... }]}
[/code]
Datatable successfully retrieves data from server, but it cannot parse data and render on page. I have no error on firebug. Is there anyone having the same issue?
Here is our code
HTML
[code]
User name
Source
DN(s)
[/code]
Javascript
[code]
$(document).ready(function() {
$("#tblUser").dataTable({
"bProcessing": true,
"bSort" : false,
"bServerSide": true,
"sAjaxSource": "${ctx}/jsp/struts/resource/fseuser/fseuser.do?method=generalUserList",
"aoColumnDefs": [
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 0 ]
},
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 1 ]
},
{
"fnRender": function ( oObj ) {
return "test";
},
"bUseRendered": false,
"aTargets": [ 2 ]
}
]
});
});
[/code]
And this is our responded data:
[code]
{"sEcho":0,"iTotalRecords":"10","iTotalDisplayRecords":"27","aaData":[{"acpId":"","acps":[],"certificate":[],"createDate":"2012-10-24 11:33:49","createUserKey":"","desc":"","descHtml":"","displayName":"cly4" .... }]}
[/code]
Datatable successfully retrieves data from server, but it cannot parse data and render on page. I have no error on firebug. Is there anyone having the same issue?
This discussion has been closed.
Replies
Allan
Allan
[code]
return "test";
[/code]
, have no idea why firebug does not jump into that line
No - fnRender will still work in 1.9. It is removed in 1.10.
> what do you mean about not using server side processing?
You haven't enabled server-side processing ( bServerSide ), so those parameters mean nothing to DataTables - they aren't used at all, since you are using client-side processing ( http://datatables.net/usage/server-side ).
Allan
> "bServerSide": true
You do you server-side processing. In which case your JSON return is wrong. sEcho should never ever be 0. It starts at 1 and increments by one for each draw. Also iDisplayRecords and iTotalDisplayRecords should be integers and not strings.
Allan
Sounds like a bug that was fixed ;-)
Good to hear you've got it working now.
Allan