How to use dataTable with server processing data
How to use dataTable with server processing data
Hi,
I'm new in jQuery and DataTables. I'm trying to use dataTable to build the table dynamically with the JSON data received via PHP return. The JSON message is returned from PHP and the format is exactly the same as the one in http://datatables.net/usage/server-side. However, the data isn't build into the table when using dataTable, please kindly advise if any I can do to solve this issue. Thank you.
I use the following Javascript code in my page for loading dataTable:
$(document).ready(function() {
$("#recordTable").dataTable( {
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "Ajax/getRecord.php",
});
});
The return data is not showing in the HTML table:
Column1
Column2
Column3
Column4
Column5
Column6
Column7
Column8
I'm new in jQuery and DataTables. I'm trying to use dataTable to build the table dynamically with the JSON data received via PHP return. The JSON message is returned from PHP and the format is exactly the same as the one in http://datatables.net/usage/server-side. However, the data isn't build into the table when using dataTable, please kindly advise if any I can do to solve this issue. Thank you.
I use the following Javascript code in my page for loading dataTable:
$(document).ready(function() {
$("#recordTable").dataTable( {
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : "Ajax/getRecord.php",
});
});
The return data is not showing in the HTML table:
Column1
Column2
Column3
Column4
Column5
Column6
Column7
Column8
This discussion has been closed.
Replies
$("#ButtonA").click = function(){
oTable.fnAddData(["1","2","3","4","5","6","7","8"]);
}
However, nothing change to the table. Can anyone help me. Thank you.
I feel so strange that the problem is solved after I changed the "bServerSide" to false. However, I just followed the instruction in Server-Side processing page but it didn't work properly.
Anyway, I can use it now.