【发布时间】:2018-09-17 21:03:06
【问题描述】:
我有一张 id 为教师表的表。我为此使用数据表。代码如下。
this.teacherstable = jQuery('#teacherstable').DataTable({
"language": {
"emptyTable": "No records to display.",
},
responsive: true,
"pageLength": 10,
"bLengthChange": false,
"data": this.teachers,
"order": [[0, "desc"]],
"columns": [
{
"title": "Modified Date",
"mData": null,
"mRender": function (data, type, row) {
return row["ModifiedDate"];
},
"visible": false,
"bSortable": true,
},
{
"title": "Teacher Name",
"mData": null, "mRender": function (data, type, row) {
return row["FirstName"] + " " + row["LastName"];
}
},
{
"title": "Email",
"mData": null, "mRender": function (data, type, row) {
return row["Email"];
}
},
{
"title": "Mobile Number",
"mData": null, "mRender": function (data, type, row) {
return row["PhoneNumber"];
}
},
{
"title": "Date Of Birth",
"mData": null, "mRender": function (data, type, row) {
return row["DateofBirth"];
}
},
],
});
现在我的问题是我从服务器获取教师数据。基于收到的数据,我必须启用和禁用属性为 pagination:false 的数据表中的分页。这个怎么做。任何建议都会有很大帮助。
【问题讨论】:
标签: jquery angular datatable datatables