"""剑道用户界面网格"""
我的网格无法显示号码记录和总页数和下一页
网格页脚显示“没有要显示的项目”
上一个和下一个符号 << < 0 > >>
我放了 pageable 或 pagesize 但为什么不显示 T_T
请帮我 !!!
var dataSourceUser = new kendo.data.DataSource({
transport: {
read: "adminUser.php?action=view",
destroy: {
url: function (options) {
$.ajax(
{
type: 'POST',
url: 'adminUser.php?action=delete',
data: {
UserID: options.UserID
},
complete: function(e) {
$("#gridUser").data("kendoGrid").dataSource.read();
}
});
return;
},
dataType : "json"
},
create: {
url: function (options) {
$.ajax(
{
type: 'POST',
url: 'adminUser.php?action=create',
data: {
Username: options.Username,
Password: options.Password,
PCUID: options.PCUID,
adp_id: options.adp_id
},
complete: function(e) {
$("#gridUser").data("kendoGrid").dataSource.read();
}
});
return;
},
dataType : "json"
},
update: {
url: function (options) {
$.ajax(
{
type: 'POST',
url: 'adminUser.php?action=update',
data: {
UserID: options.UserID,
Username: options.Username,
Password: options.Password,
PCUID: options.PCUID,
adp_id: options.adp_id
},
complete: function(e) {
$("#gridUser").data("kendoGrid").dataSource.read();
}
});
return;
},
dataType : "json"
},
parameterMap: function(options, operation) {
if (operation !== "read") {
return {models: kendo.stringify(options.models)};
}
return options;
}
},
batch: false,
pageSize: 15,
schema: {
data: "data",
model: {
id: "UserID",
fields: {
UserID: { editable: false, nullable: true },
Username: { validation: { required: true } },
Password: { validation: { required: true } },
PCUID: { validation: { required: true } },
adp_id: { validation: { required: true } }
}
}
}
});
$("#gridUser").kendoGrid({
dataSource: dataSourceUser,
pageable: true,
toolbar: ["create"],
pageable: true,
columns: [
{ field:"UserID", title: "UserID", width: "100px" },
{ field:"Username", title: "Username", width: "100px" },
{ field:"Password", title: "Password", width: "200px" },
{ field:"PCUID", title: "PCUID", width: "100px" },
{ field:"adp_id", title: "adp_id", width: "200px" },
{ command: ["edit", "destroy"], title: " ", width: "160px" }],
editable: "popup"
});
管理员用户.php
{"data":[{"UserID":"1","Username":"test1","Password":"1234","PCUID":"001","adp_id":"1"},{"UserID":"2","Username":"test2","Password":"1234","PCUID":"002","adp_id":"2"}]}