Unexpected behavior of set filterable options operator for numeric column of kendo jquery grid

1 Answer 121 Views
Filter Grid
Andrew
Top achievements
Rank 1
Andrew asked on 23 Sep 2021, 02:58 PM

Hi All.

I have a funny issue.

I am building kendo grid and set filtrable options.operators for number/integer column but the options are ignored and set to defaults, however same options for string liters are respected. UI element set for the integer type is respected as well. 

 

this how I build column

 

column.filterable = {
ui(element) {
element.kendoNumericTextBox({
format: '####',
decimals: 0,
});
},
operators: this.commonService.gridFilterNumberOperators.operators
};
} else if (
column.filterType != undefined &&
lstDateFields.indexOf(column.applicationDataType) > -1 &&
lstDateFields.indexOf(column.filterType.toLowerCase()) > -1
) {
column.filterable = {
ui(element) {
element.kendoDatePicker({
format: 'MM/dd/yyyy',
});
},
};
} else if (
column.filterType != undefined &&
column.filterType.toLowerCase() === 'string'
) {
column.filterable = this.commonService.gridFilterStringOperators;
}

options for integer column

option for string 

this how I initialize grid

 

kendo.jQuery(this.gridConfigurationTemplate.nativeElement).html('');
this.gridConfigurationTemplate.nativeElement.innerHTML = '';

kendo
.jQuery(this.gridConfigurationTemplate.nativeElement)
.data('kendoGrid')
.setOptions(options);

//this.bindTooltipForDispatcherGrid();
grid = kendo
.jQuery(this.gridConfigurationTemplate.nativeElement)
.data('kendoGrid');
grid.dataSource.page(1);

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 28 Sep 2021, 10:20 AM

Hi, Andrew,

Thank you for the provided code snippets.

I tested the filterable configuration of the columns, however everything seems to be functioning properly:

https://dojo.telerik.com/@gdenchev/AQufIraq 

Could you make sure that the type of the field is set to "number" in the schema.model of the DataSource?

    dataSource: {
      schema: {
        model: {
          fields: {
            MyNumberField: { type: "number" }
          }
        }
      }
    },

Let me know in case the problem continues to persist.

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Filter Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or