How to use dataTable with server processing data

How to use dataTable with server processing data

yam1234yam1234 Posts: 9Questions: 0Answers: 0
edited February 2010 in General
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

Replies

  • yam1234yam1234 Posts: 9Questions: 0Answers: 0
    I found that I can't interact with the table. I just test it by the following code:
    $("#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.
  • yam1234yam1234 Posts: 9Questions: 0Answers: 0
    Problem is solved!!

    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.
This discussion has been closed.