-1

"""剑道用户界面网格"""

我的网格无法显示号码记录和总页数和下一页

网格页脚显示“没有要显示的项目”

上一个和下一个符号 << < 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: "&nbsp;", 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"}]}
4

1 回答 1

0

在这种情况下,您需要查看网络流量。在 Chrome 中,只需按 F12 并转到“网络”选项卡。

一旦出现(取决于浏览器),您应该会看到对“adminUser.php?action=view”的请求,希望结果是带有请求数据的 JSON。

根据您的设置,它期望:

{
    data: [
        { UserID: 123, Username: 'abc', Password: 'abc', PCUID: 123, adp_ip: 123 },
        { UserID: 456, Username: 'abc', Password: 'abc', PCUID: 123, adp_ip: 123 }
    ]
}
于 2013-08-19T03:45:04.847 回答