Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.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网格验证_Javascript_Jquery_Kendo Ui_Kendo Grid - Fatal编程技术网

Javascript 创建新行时的剑道UI网格验证

Javascript 创建新行时的剑道UI网格验证,javascript,jquery,kendo-ui,kendo-grid,Javascript,Jquery,Kendo Ui,Kendo Grid,目前,我希望在保存更改之前验证新创建的行, 架构无法对创建的行强制执行规则。 我需要让用户知道,如果他试图用错误消息保存,需要哪些字段 这个示例已经有了自定义验证,您可以在模式中看到它,问题是它在提交到服务器之前没有强制验证 var gResult = new kendo.data.DataSource({ read:, update:, create:, schema: { model: { id

目前,我希望在保存更改之前验证新创建的行, 架构无法对创建的行强制执行规则。 我需要让用户知道,如果他试图用错误消息保存,需要哪些字段


这个示例已经有了自定义验证,您可以在模式中看到它,问题是它在提交到服务器之前没有强制验证

var gResult = new kendo.data.DataSource({
    read:,
    update:,
    create:,
     schema: {
            model: {
                    id: "Id",
                    fields: {
                    Id: { type: 'number' },
                    Color: { type: 'string', defaultValue: "#000" },
                    Name: {type: 'string', validation: { required: true } },
                    Address1: { validation: { required: true } },
                    City: { validation: { required: true } },
                    Country: { validation: { required: true }, defaultValue: "Deutchland" },
                    PostalCode: { type: 'number', validation: { required: true } },
                    Emails: {
                        type: 'string',
                        validation: {

                            required: { message: "Email ID Required." },
                            validateEmailFormat: function (input) {
                                if (input.attr("data-bind") == "value:Email") {
                                    input.attr("data-validateEmailFormat-msg", "Email format invalid.");
                                    return checkEmail(input.val());
                                }
                                return true;
                            }
                        }
                    }
                }
            }

    });

      $("#gridResult").kendoGrid({

            columns: GridColumns.Columns,
            dataSource: gResult,
            navigatable: true,
            sortable: true,
            height: 1000,
            filterable: true,
            pageable: GridProp.Pageable,
            editable: true, toolbar: ["create", "save"] });

看看这个例子已经有了自定义验证,你可以在模式中看到它,问题是它在提交到服务器之前没有强制验证。@sandmahelllp!!!!我也有同样的问题