如何在编辑过程中使Kendo Grid Pop up Editor与网格无关

时间:2017-07-24 09:41:41

标签: javascript jquery kendo-ui kendo-grid

当我从弹出编辑器进行编辑时,如何停止网格同时显示已编辑的字段,我希望它仅在我按下UPDATE按钮时显示已编辑的字段!以下是我的代码,它用于更新我的网格,但是当我从弹出编辑器进行编辑时,同时我看到网格显示更新的字段,我想停止它

dataSource = new kendo.data.DataSource({
                    transport: {
                        read: function (options) {
                            options.success(result); // where data is the local data array
                        },
                        update: function (options) {

                            $.ajax({
                                type: "POST",
                                url: "/AdminTool/update_grid",
                                data: options.data.models[0],
                                dataType: "json",
                                success: function (data) {
                                    options.success(data);
                                    // alert("success");
                                },
                                error: function (data) {
                                    options.error(data);
                                    //  alert("error");
                                },
                            });

                        },

                        parameterMap: function (options, operation) {
                            if (operation !== "read" && options.models) {
                                return { models: kendo.stringify(options.models) };
                            }
                        }
                    },
                    batch:true,
                    pageSize: 40,
                    schema: {
                        //data: employee,
                        model: {
                            id: "DeviceIP",
                            fields: {
                                DeviceIP: { editable: false, nullable: true },
                                Producer: { type:"string" },
                                Model: { type: "string" },
                                DeviceType:{ type:"string" },
                                Description:{ type:"string" },
                                Username:{ type:"string" },
                                Password:{ type:"string" },
                                PublicIP: { type: "string" },
                                //UnitPrice: { type: "number", validation: { required: true, min: 1} },
                                //Discontinued: { type: "boolean" },
                                //UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                            }
                        }
                    }
                    });

0 个答案:

没有答案