Templates 剑道网格列号格式
如果绑定2个数据值,如何在剑道列中设置数字格式?在我的例子中,我必须用单位绑定值,所以我需要一个用2个小数写的值。 我的代码如下所示:Templates 剑道网格列号格式,templates,kendo-ui,kendo-grid,number-formatting,Templates,Kendo Ui,Kendo Grid,Number Formatting,如果绑定2个数据值,如何在剑道列中设置数字格式?在我的例子中,我必须用单位绑定值,所以我需要一个用2个小数写的值。 我的代码如下所示: { field: "Quantity", title: "Value ", width: "70px", type: "number", format:"{0:n2}", template: "#:Quantity# #:Unit#", attributes:{style:"text-align:right
{
field: "Quantity",
title: "Value ",
width: "70px",
type: "number",
format:"{0:n2}",
template: "#:Quantity# #:Unit#",
attributes:{style:"text-align:right;"}
},
在不绑定到单元的情况下,它工作得很好,但是对于单元,我有一个问题。提前感谢这将格式化
数量
以2位小数的数字显示
template: '#= kendo.toString(Quantity, "n2")# #=Unit#'
我应该把它放到我的列属性中吗?我试过了,但没有成功:/I我丢失了一个
#
标志。用上面的方法再试一次。效果很好,非常感谢,不幸的是我没有足够的声誉来标记你的评论,但是非常感谢!!