JSON formats and Columns
JSON formats and Columns
My html code for table is as follow
[code]
[/code]
I initialize datatables by using the following code
[code]
$(document).ready(function() {
$('#tableListing').dataTable({
"bAutoWidth" : true,
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : '${actionUrl}'
});
});
[/code]
I have two formats of JSON as below
[code]
{"creationTime":0,"enabled":false,"id":105,"loginDuration":0,"online":false,"password":"asdasd","userName":"asd1212123"}
and
[1,"abiieez",true]
[/code]
Only the second JSON format is acceptable by my datatable, I believe this because of the number of columns have matched. How can I make my datatables can accept the first JSON format eventhough I am only gonna show three columns only ?
[code]
[/code]
I initialize datatables by using the following code
[code]
$(document).ready(function() {
$('#tableListing').dataTable({
"bAutoWidth" : true,
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : '${actionUrl}'
});
});
[/code]
I have two formats of JSON as below
[code]
{"creationTime":0,"enabled":false,"id":105,"loginDuration":0,"online":false,"password":"asdasd","userName":"asd1212123"}
and
[1,"abiieez",true]
[/code]
Only the second JSON format is acceptable by my datatable, I believe this because of the number of columns have matched. How can I make my datatables can accept the first JSON format eventhough I am only gonna show three columns only ?
This discussion has been closed.
Replies
Also note that if you want to use server-side processing (bServerSide) you MUST implement that DataTables server-side processing protocol: http://datatables.net/usage/server-side .
Allan
Is there a way for me to pick which column I would like to show on the client-side ?