Kendo ui grid - 特定单元格上的复选框,模态或单选按钮

时间:2016-12-02 12:15:49

标签: javascript jquery kendo-ui kendo-grid

需要帮助。

Kendo ui Grid

Kendo网格代码:

 $('#triggerParameterData').kendoGrid({
    columns: [{field: "name"},{field: "value"},{field: "description"}],

    selectable: "multiple,row",
    pageable: false,

    scrollable: false,
    editable: true,
    dataSource: {
        data: popup, schema: {
            model: {
                fields: {
                    name: { editable: false },
                    description: { editable: false },

                }
            }
        }
    },
})

我想将第二行值单元格放入复选框。如果有人有解决方案请分享。 特别感谢。

2 个答案:

答案 0 :(得分:0)

参考:Kendo Grid Columns.Template

.....
columns: [

    {field: "name"},
    {field: "value", template: '<input type="checkbox" value="#: value #">'},
    {field: "description"}

]
......

答案 1 :(得分:0)

使用此fiddle

<强> JS:

var popup = [ { value:true, name: "Enos", description: "Es" },
                      { value:true,name: "Ray", description: "Rs" },
                      { value:true,name: "Justice", description: "Js" },
                      { value:true,name: "RR", description: "ESW" },
                      { value:true,name: "Gop", description: "Gp" },
                      { value:true,name: "DS", description: "JN" },
                      { value:true,name: "Raven", description: "Rv" },
                      { value:true,name: "FD", description: "FDGH" },
                      { value:true,name: "Andrew", description: "Ar" },
                      { value:true,name: "DDD", description: "GFG" },
                      { value:true,name: "Shayne", description: "S" },
                      { value:true,name: "YYY", description: "GHFGH" },
                      { value:true,name: "Walter", description: "W" },
                      { value:true,name: "EEE", description: "LUIO" },
                      { value:true,name: "ZKZG", description: "RD" },
                      { value:true,name: "JJJ", description: "FGJHGH" }];

        $(document).ready(function () {
            $('#triggerParameterData').kendoGrid({
                columns: [{ field: "name" },
                          { field: "value", template: '<input type="checkbox" value="#: value #">' },
                          { field: "description" }],

                selectable: "multiple,row",
                pageable: false,

                scrollable: false,
                editable: true,
                dataSource: {
                    data: popup, schema: {
                        model: {
                            fields: {
                                name: { editable: false },
                                value: { editable: false },
                                description: { editable: false },

                            }
                        }
                    }
                },
            })

        });