How to change the format of a Kendo mesh filter

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

The problem is that when I use the filter and type “1000”, when I go back to the filter to put another number, it displays “1,000.00”. I do not want the filtered text field to display a comma or decimal point. This format does not apply to this field.

How to fix it?

Thanks in advance!

+4
source share
4 answers

While @Flores's answer pointed me in the right direction, he did not do what was expected. At least I still had commas in my filter using its fragment. As a result, I made a small modification of the code to achieve the desired result.

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

This will give you only numbers. No commas or decimals.

+8
source

You can set the format in the filter in the column as follows:

  field: "TaskId", title: "TaskId", width: 80, filterable: { ui: function (element) { element.kendoNumericTextBox({ format: "n0" }); } } 
+1
source

You must use a custom filter menu. Here 's how to create a DDL. In your case, you will need to create a numeric text field in a specific format.

0
source

Per Kendo Support:

If filterable.mode is set to "row", use columns.filterable.cell.template to configure input. Please refer to this example http://dojo.telerik.com/UKulA/2 .

You can limit the range using min and max, as in the example above.

0
source

All Articles