Datatables treats String variable like a C-string(char[])?
Datatables treats String variable like a C-string(char[])?
Hi!
I saw a little bit strange behavior on Datatables plugin. In my case it treats String variable as char[] and it puts next char values into the column... Here is the code on the client-side:
[code]("#browseFriendsAndFamily").click(function(){
var contPath='<%=request.getContextPath()%>';
$.get(contPath + "/friendFamily/getFriendsByUserId",
"userId="+loggedUser.id, function(friendsList){
$("#friendFamilyDialog").dialog("open");
friendsTable = $("#friendsTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [ {"bVisible": false, "bSortable": false, "aTargets": [3]}],
"bSortClasses": false
});
familyTable = $("#familyTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [ {"bVisible": false, "bSortable": false, "aTargets": [3]}],
"bSortClasses": false
});
for(var i=0, length=friendsList.length; i
I saw a little bit strange behavior on Datatables plugin. In my case it treats String variable as char[] and it puts next char values into the column... Here is the code on the client-side:
[code]("#browseFriendsAndFamily").click(function(){
var contPath='<%=request.getContextPath()%>';
$.get(contPath + "/friendFamily/getFriendsByUserId",
"userId="+loggedUser.id, function(friendsList){
$("#friendFamilyDialog").dialog("open");
friendsTable = $("#friendsTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [ {"bVisible": false, "bSortable": false, "aTargets": [3]}],
"bSortClasses": false
});
familyTable = $("#familyTable").dataTable({
"bJQueryUI": true,
"aoColumnDefs": [ {"bVisible": false, "bSortable": false, "aTargets": [3]}],
"bSortClasses": false
});
for(var i=0, length=friendsList.length; i
This discussion has been closed.
Replies
Allan
Yes, you are right - I should use
[code]friendsTable.fnAddData([surname, name,
login, id]);[/code]
Instead:
[code]friendsTable.fnAddData(surname, name,
login, id);[/code]
I simply forgot about [ ] - I want to thank you very much for help because I lost 2 days for thinking what I am doing wrong :)
Thank you again.
With veeeery cheerful greetings,
Pneumokok.