Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/423.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 剑道UI网格未触发传输创建URL_Javascript_Kendo Ui - Fatal编程技术网

Javascript 剑道UI网格未触发传输创建URL

Javascript 剑道UI网格未触发传输创建URL,javascript,kendo-ui,Javascript,Kendo Ui,我有一个kendoUI网格从web服务中执行CRUD。出于某种原因,read命令可以完美地工作并填充我的网格 但是,当我尝试创建新记录时,尽管它在网格中显示新记录,并且我可以编辑其字段,但ButtonSave不会触发web服务 查看http日志,我发现该服务没有成功。只有在阅读时 这是电网的代码: $(function() { $("#grid").kendoGrid({ dataSource: {

我有一个kendoUI网格从web服务中执行CRUD。出于某种原因,read命令可以完美地工作并填充我的网格

但是,当我尝试创建新记录时,尽管它在网格中显示新记录,并且我可以编辑其字段,但ButtonSave不会触发web服务

查看http日志,我发现该服务没有成功。只有在阅读时

这是电网的代码:

$(function() {
            $("#grid").kendoGrid({
                dataSource: {
                    transport: {
                        read: "libyMsg.php?way=getUsrMsgList"
                    },
                    create: {
                        url: "libyMsg.php?way=createMsg",
                        type: "PUT"
                    },
                    update: {
                        url: "libyMsg.php?way=updateeMsg",
                        type: "PUT"
                    },destroy: {
                        url: "libyMsg.php?way=destroyMsg",
                        type: "PUT"
                    },
                    batch: true,
                    pageSize: 10,
                    schema: {
                        data: "data",
                        model: {
                            id: "msg_id",
                            fields: {
                                msg_id: { editable: false, nullable: true },
                                msg_title: { validation: { required: true } },
                                msg_content: {  validation: { required: true } },
                                msg_type: { type: "number", validation: { min: 0, required: true }},
                                msg_date: { type: "date", validation: { required: true } },
                                msg_status: { type: "number", validation: { min: 0, required: true } }
                            }
                        }
                    },
                },
                columns: [{ field: "msg_id", width: 40,title: "ID" },
                    { field: "msg_title",width: 300, title: "Title" },
                    { field: "msg_content", width: 300,title: "Content" },
                    { field: "msg_type", width: 40,title: "Type" },
                    { field: "msg_date", width: 300,title: "Date" }, 
                    { field: "msg_status", width: 40,title: "Status" }],
                scrollable: true,
                sortable: true,
                editable:true,
                pageable: {
                    refresh: true,
                    pageSizes: true
                },
                toolbar: ["create", "save", "cancel"],
            });
        });
这让我快发疯了。有人吗

Ty/M

您的交通工具有问题。请尝试以下方法:

transport:{
    read      :"libyMsg.php?way=getUsrMsgList",
    create    :{
        url :"libyMsg.php?way=createMsg",
        type:"PUT"
    },
    update    :{
        url :"libyMsg.php?way=updateeMsg",
        type:"PUT"
    },
    destroy:{
        url :"libyMsg.php?way=destroyMsg",
        type:"PUT"
    }
},
创建、更新和销毁应该是传输的一部分。

您的传输错误。请尝试以下方法:

transport:{
    read      :"libyMsg.php?way=getUsrMsgList",
    create    :{
        url :"libyMsg.php?way=createMsg",
        type:"PUT"
    },
    update    :{
        url :"libyMsg.php?way=updateeMsg",
        type:"PUT"
    },
    destroy:{
        url :"libyMsg.php?way=destroyMsg",
        type:"PUT"
    }
},
创建、更新和销毁应该是传输的一部分