我在我的 MVC 项目中使用数据表进行排序和分页。所以分页和排序是有效的。
现在的问题是——
我已经展示pagesize:5
了数据表。它每页显示 5 行,但不显示pagenumbers
. 如何使用 kendo 数据源显示分页以显示下一个页码的下 5 个数据行。
看看我的代码——
var template = kendo.template($("#template").html());
// To Do Item Data
// ---------------
// Build the data source for the items
var dataSource = new kendo.data.DataSource(
{ transport: {
read: "/Task/Read"
}, schema: {
data: "Data"
},
serverGrouping: true,
sort: { field: "TaskID", dir: "asc" },
serverPaging: true,
pageSize: 5
});
// When the data source changes, render the items
dataSource.bind("change", function (e) {
//alert('Bind');
var html = kendo.render(template, this.view());
$("#todos tbody").html(html);
});
// Initial read of the items in to the data source
dataSource.read();
</script>
HTML 代码-
<tr>
<td>
<input type="checkbox" class="done" data-id="#= TaskID #" ></input>
</td>
<td>
#= TaskID #
</td>
<td>
#= Subject #
</td>
<td>
#=AssignedTo#
</td>
</tr>
</script>
<div class="row-fluid">
<div class="span4"> <table id="todos" class="table table-striped table-bordered">
<thead>
<tr>
<th>Done</th>
<th>ID</th>
<th>Task</th>
<th>Assign To</th>
</tr>
</thead>
<tbody>
</tbody>
</table></div>
</div>
请告诉我如何显示页码以显示其余行。我已经从 kendo UI Grid 迁移到 kendo 数据源并使用引导程序对其进行样式设置。