serverside, objectbased reading does not work
serverside, objectbased reading does not work
Hallo,
i have a problem using serverside & objectbased data with datatables. (aaData rows as Objects)
Agent: Moz. FF 3.6.17 (only tried on this atm)
DataTables: 1.7.6
jQuery: 1.6.1
jQueryUI: 1.8.12
jQuery-/UI Plugins: only DataTables
DataTables Plugins: none
This is the initialisation i used to test it:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "debug.php",
"aoColumns": [
{ "mDataProp": "col_1_prop_name" },
{ "mDataProp": "col_2_prop_name" },
{ "mDataProp": "col_3_prop_name" }
]
} );
} );
[/code]
Inside body:
[code]
col 1
col 2
col 3
[/code]
Server response JSON:
[code]
{
"sEcho" : 1,
"iTotalRecords" : 9,
"iTotalDisplayRecords" : 9,
"aaData": [
{ "col_1_prop_name" : 2, "col_2_prop_name" : "some data 1" , "col_3_prop_name" : "test 1" },
{ "col_1_prop_name" : 3, "col_2_prop_name" : "some data 2" , "col_3_prop_name" : "test 2" },
{ "col_1_prop_name" : 4, "col_2_prop_name" : "some data 3" , "col_3_prop_name" : "test 3" },
{ "col_1_prop_name" : 5, "col_2_prop_name" : "some data 4" , "col_3_prop_name" : "test 4" },
{ "col_1_prop_name" : 6, "col_2_prop_name" : "some data 5" , "col_3_prop_name" : "test 5" },
{ "col_1_prop_name" : 7, "col_2_prop_name" : "some data 6" , "col_3_prop_name" : "test 6" },
{ "col_1_prop_name" : 8, "col_2_prop_name" : "some data 7" , "col_3_prop_name" : "test 7" },
{ "col_1_prop_name" : 9, "col_2_prop_name" : "some data 8" , "col_3_prop_name" : "test 8" },
{ "col_1_prop_name" : 10, "col_2_prop_name" : "some data 9" , "col_3_prop_name" : "test 9" }
]
}
[/code]
DataTables warning (table id = 'example'): Added data (size undefined) does not match known number of columns (3)
i have a problem using serverside & objectbased data with datatables. (aaData rows as Objects)
Agent: Moz. FF 3.6.17 (only tried on this atm)
DataTables: 1.7.6
jQuery: 1.6.1
jQueryUI: 1.8.12
jQuery-/UI Plugins: only DataTables
DataTables Plugins: none
This is the initialisation i used to test it:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "debug.php",
"aoColumns": [
{ "mDataProp": "col_1_prop_name" },
{ "mDataProp": "col_2_prop_name" },
{ "mDataProp": "col_3_prop_name" }
]
} );
} );
[/code]
Inside body:
[code]
col 1
col 2
col 3
[/code]
Server response JSON:
[code]
{
"sEcho" : 1,
"iTotalRecords" : 9,
"iTotalDisplayRecords" : 9,
"aaData": [
{ "col_1_prop_name" : 2, "col_2_prop_name" : "some data 1" , "col_3_prop_name" : "test 1" },
{ "col_1_prop_name" : 3, "col_2_prop_name" : "some data 2" , "col_3_prop_name" : "test 2" },
{ "col_1_prop_name" : 4, "col_2_prop_name" : "some data 3" , "col_3_prop_name" : "test 3" },
{ "col_1_prop_name" : 5, "col_2_prop_name" : "some data 4" , "col_3_prop_name" : "test 4" },
{ "col_1_prop_name" : 6, "col_2_prop_name" : "some data 5" , "col_3_prop_name" : "test 5" },
{ "col_1_prop_name" : 7, "col_2_prop_name" : "some data 6" , "col_3_prop_name" : "test 6" },
{ "col_1_prop_name" : 8, "col_2_prop_name" : "some data 7" , "col_3_prop_name" : "test 7" },
{ "col_1_prop_name" : 9, "col_2_prop_name" : "some data 8" , "col_3_prop_name" : "test 8" },
{ "col_1_prop_name" : 10, "col_2_prop_name" : "some data 9" , "col_3_prop_name" : "test 9" }
]
}
[/code]
DataTables warning (table id = 'example'): Added data (size undefined) does not match known number of columns (3)
This discussion has been closed.
Replies
Thx :-=