屏蔽UI网格在编辑分组时的错误值

时间:2018-12-13 23:24:38

标签: javascript grid grouping edit shieldui

我正在测试此网格。它具有几个有趣的功能。但是做一些非常基本的事情,我发现一个问题,使它几乎无法使用。

将网格分组时。如果我尝试编辑任何记录,则可编辑字段中显示的值与记录不对应。之后,注册表中的所有数据都会丢失。

Here is a codepen

[https://codepen.io/ariel-larraburu/pen/xmZPOJ][1]

HTML:

<div id="grid"></div>

JavaScript:

   jQuery(function ($) {
        $("#grid").shieldGrid({
            dataSource: {
                data: gridData,    
                schema: {
                          fields: window.orderFields = {
                            "name": {path: "name", type: String},  
                            "company": {path: "company", type: String},  
                            "email": {path: "email", type: String}  
                          }
                        },
                group: [{ field: "company", order: "asc" }]
            },
        rowHover: false,
        sorting: {
            multiple: false
        },
        selection: {
            type: "row",
            multiple: false,
            toggle: false
        },
        grouping: {
            showGroupHeader: true,
            allowDragToGroup: true,
            message: "Arrastrar aqui para agrupar"
        },
        scrolling: true,
        columnReorder: true,
        resizing: true,
        filtering: {
            enabled: true
        },
            columns: [                
                { field: "id", width: "70px", title: "ID", editable: true, groupFooterTemplate: "Cant. : {count}" },
                { field: "name", title: "Person Name", editable: true, groupFooterTemplate: "Cant. : {count}" },
                { field: "company", title: "Company Name", editable: true, groupFooterTemplate: "Cant. : {count}" },
                { field: "email", title:"Email Address", width: "270px", editable: true, groupFooterTemplate: "Cant. : {count}" }
            ],
        editing: {
            enabled: true,
            event: "doubleclick",
            type: "cell"
        }          
        });
    });   

0 个答案:

没有答案