我正在关注
the example here.使用包含对象的数组.
我在这样的for循环中创建我的数组
historyArray[i] = { "User": strUserName,"Timestamp" : date.toString(),"Latitude" : point.lat,"Longitude" : point.lng };
我的数据表实现:
$(document).ready(function() { $('#dynamic').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="report"></table>'); $('#report').dataTable({ "aaData": historyArray,"aoColumns": [ { "mDataProp": "User" },{ "mDataProp": "Timestamp" },{ "mDataProp": "Latitude" },{ "mDataProp": "Longitude" } ],"bJQueryUI": true,"sPaginationType": "full_numbers","sDom": '<"H"Tfr>t<"F"ip>',"oTableTools": { "sSwfPath": "swf/copy_csv_xls_pdf.swf","aButtons": ["copy","csv","xls","pdf"] } }); });