我将jquery数据表更新为最新版本的jquery数据表。但是在更新之后它没有从服务器获取数据。
var questionTable = $('#questionsTable').dataTable({
"bServerSide": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
"sServerMethod": "POST",
"sAjaxSource":app.baseUrl+ "/courses/question-api/get-question-list",
"sAjaxDataProp":"aaData",
"aoColumns":[
null,
null,
null,
null,
{
"sName":"userName",
"bSearchable":false,
"bSortable":false,
"mRender":function (oObj) {
$markup = "<a id='view_link' class='adminlink' data-val='"+oObj.aData[4]+"' href='../courses/question/details?question_id=" + oObj.aData[4] + "' title='View'><span class='glyphicon glyphicon-eye-open'></span></a><a class='adminlink' title='Edit question' href='" + app.baseUrl + "/courses/question/edit?question_id=" + oObj.aData[4] + "' ><span class='glyphicon glyphicon-pencil'></span></a>"
return $markup;
}
}
]
});
答案 0 :(得分:2)
第一步,阅读此https://datatables.net/upgrade/1.10-convert
许多选项在数据表1.10中不再有效。尝试修复它,然后再问你的问题。