如何更改Kendo网格过滤器格式

如何更改Kendo网格过滤器格式

问题描述:

我的网格中有一个字段,其ID的范围从1到2000.我在字段定义中将其指定为数字.

I have a field in my grid that are IDs that range from 1 to 2000. I have it designated as a number in the field definition.

问题是当我使用过滤器并输入"1000"时,当我返回过滤器以输入另一个数字时,它会显示"1,000.00".我不希望过滤后的文本框显示逗号或小数点.该格式与该字段无关.

The issue is when I use the filter and type in say "1000" when I return to the filter to put in another number it displays "1,000.00". I don't want the filtered text box to show the comma or decimal point. That format isn't relevant for this field.

我该如何纠正?

提前谢谢!

虽然@Flores的回答向我指出了正确的方向,但它没有完成预期的工作.至少我仍然使用他的代码片段在逗号中添加了逗号.最后,我对代码进行了少量修改,以实现所需的结果.

While @Flores answer pointed me in the right direction, it did not do what was expected. At least I still had commas in my filter using his snippet. I ended up making a small modification to the code to achieve the desired result.

filterable: {
    ui: function (element) {
        element.kendoNumericTextBox({
            format: '#',
            decimals: 0,
        });
    },
},

那只会给你数字.没有逗号,没有小数点.

That will give you only numbers. No commas and no decimals.