Kendo ui 剑道格式带空格的数字

Kendo ui 剑道格式带空格的数字,kendo-ui,Kendo Ui,我正在使用剑道,我想在我的网格列中用空格格式化一个数字,如下示例: 123456789至123456789 但是我没有找到这种格式 有人知道吗?要使用空格作为千位分隔符格式化数字,您可以使用以下答案: 假设没有小数: function numberWithSpaces(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } 那么您的列定义将是 { field: "Especes", title:

我正在使用剑道,我想在我的网格列中用空格格式化一个数字,如下示例: 123456789至123456789 但是我没有找到这种格式


有人知道吗?

要使用空格作为千位分隔符格式化数字,您可以使用以下答案:

假设没有小数:

function numberWithSpaces(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
} 
那么您的列定义将是

{ 
  field: "Especes", 
  title: "Hello",
  template: function(dataItem) {
    return "<span>" + numberWithSpaces(dataItem.Especes) + "</span>"
  }
}

如何通过jquery或HTML帮助程序配置网格?这是我的代码:列:[{title:Hello,template::speces€,字段:speces,格式:{0:c},我想要使用spacesHow about->template:=jsfunctiontoperformattingspecies的格式,或者您是在问是否有一个使用空格的数字格式函数?我愿意接受两种解决方案,在我的数字中插入空格。如何使用此函数jsfunctiontoperformattingspeces?