编辑时剑道网格轮数?

时间:2014-09-17 00:33:32

标签: kendo-ui kendo-grid kendonumerictextbox

enter image description here

我正在使用Kendo网格来编辑数据。我的问题是,当我编辑一个单元格时,它将数字四舍五入到两位小数,即使单元格的格式为4位小数。

为什么它的表现如此?

1 个答案:

答案 0 :(得分:2)

您可以为该列添加editor函数。类似的东西:

columns: [
    ...
    { 
        field: "Value",
        width: 200, 
        format: "{0:##.####}", 
        editor: function(container, options) {
            // create an input element
            $("<input name='" + options.field + "'/>")
            .appendTo(container)
            .kendoNumericTextBox({
                decimals: 4
            });
        }
    },
    ...
]

在此处查看此行动:http://jsfiddle.net/OnaBai/p92d1q8z/