0

name: "Name"asでフィールドを設定したいのですが、jsgrid のドキュメント ( http://js-grid.com/docs/#grid-fields )に従ってrequired: を挿入しましたが、機能しません。validate: "required"

validate: "required"以下のjsgridフィールドのコードに挿入すると、 Namejsgridは必要な制限を受けず、ブロックを挿入します!! validateダイアログとjsgridの両方で定義できるパラメーターであるため、ダイアログ内にグリッドを囲むと問題が発生することはほぼ確実です。

これは、ダイアログ内にグリッドを正常に表示するダイアログ付きのコードですが、validate:"required" を渡すことができません。ダイアログ内のスクリーンショット Grid もアップロードしました。

$( "#DataGrid" ).dialog({minWidth: 1000, minHeight: 500});
            $("#DataGrid").jsGrid({
                    height: "100%",
                    width: "70%",
                    filtering: true,
                    editing: true,
                    inserting: true,
                    sorting: true,
                    paging: true,
                    autoload: true,
                    pageSize: 15,
                    pageButtonCount: 5,
                    datatype: "json",
                    deleteConfirm: "Do you really want to delete the client?",
                    controller: db,
                    fields: [
                        { name: "Id", align: "center", width: 45 },
                        { name: "Name", validate:"required," align: "center", type: "text", width: 45 },
                        { name: "Displayed Name(locale)", align: "center", type: "text", width: 40 },
                        { name: "Data Type", align: "center", type: "select", items: db.dataType, valueField: "Id", textField: "Name", width: 40 },
                        { name: "Initial Value", align: "center", type: "text", width: 40 },
                        { name: "Initial State", align: "center", type: "select", items: db.initialState, valueField: "Id", textField: "Name", width: 50 },
                        { name: "Worklist Order", align: "center", type: "number", width: 20 },
                        { name: "DB Datatype", align: "center", type: "text", width: 25 },
                        { name: "Allowed Values JSON", align: "center", type: "text", width: 20 },
                        { name: "Allowed Values SQL", align: "center", type: "text", width: 20 },
                        { type: "control", width: 25 }
                    ]

            });

ダイアログなしでjsgridコードを試してみましたが、動作しますが、ダイアログ内でどのように動作しますか? ダイアログなしのこのコードは機能します:

 $("#DataGrid").jsGrid({
                height: "100%",
                width: "70%",
                filtering: true,
                editing: true,
                inserting: true,
                sorting: true,
                paging: true,
                autoload: true,
                pageSize: 15,
                pageButtonCount: 5,
                datatype: "json",
                deleteConfirm: "Do you really want to delete the client?",
                controller: db,
                fields: [
                    { name: "Id", align: "center", width: 45 },
                    { name: "Name", validate:"required", align: "center", type: "text", width: 45 },
                    { name: "Displayed Name(locale)", align: "center", type: "text", width: 40 },
                    { name: "Data Type", align: "center", type: "select", items: db.dataType, valueField: "Id", textField: "Name", width: 40 },
                    { name: "Initial Value", align: "center", type: "text", width: 40 },
                    { name: "Initial State", align: "center", type: "select", items: db.initialState, valueField: "Id", textField: "Name", width: 50 },
                    { name: "Worklist Order", align: "center", type: "number", width: 20 },
                    { name: "DB Datatype", align: "center", type: "text", width: 25 },
                    { name: "Allowed Values JSON", align: "center", type: "text", width: 20 },
                    { name: "Allowed Values SQL", align: "center", type: "text", width: 20 },
                    { type: "control", width: 25 }
                ]

        });

アイデアはありますか?これは複雑な問題です。

4

1 に答える 1

0

@tabalin の助けのおかげで、問題は解決しました。jsgrid アーカイブが 1 つ減りました。今では魅力のように機能します!

于 2016-09-08T08:01:06.383 に答える