如何更改Kendo网格过滤器格式 [英] How to change Kendo Grid Filter Format

查看:73
本文介绍了如何更改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.

这篇关于如何更改Kendo网格过滤器格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆