0
我指的是this解决方案刷新数据表。我通过ajax调用获得了新刷新的JSON数据。但我不确定如何使用它。特别是,如何将其转换为兼容数据表aaData属性?如何使用aaData刷新数据表
success:
function (json){
var data = json;
table =$(#mytable).dataTable();
oSettings = table.fnSettings();
table.fnClearTable(this);
$.each(json, function (i, item) {
table.oApi._fnAddData(oSettings, json[i]);
});
oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
table.fnDraw();
}
现在,我试图直接使用json [i],这给我在数据表中的错误。另外,返回的数据是一个json对象数组。
刷新数据表使用Ajax [请参阅此链接](http://stackoverflow.com/questions/20141432/refresh-jquery-datatable-table) – user2841408
可能重复的[刷新jQuery数据表](http:// stackoverflow.com/questions/20141432/refresh-jquery-datatable-table) –