Unplanned
Last Updated: 18 Nov 2021 15:45 by Travis Cotton
Travis Cotton
Created on: 17 Nov 2021 14:19
Category: Data Source
Type: Feature Request
0
Include Field Data Types in Server Request

I selected the grid widget for this ticket, but the question is for all widgets with a remote filter service. I'm not finding a way to configure the DataSource to send the field data types, as defined in the schema, along with the filter request. The filter request array includes the field name, field value and ignore case values. It needs to also include the field data type, from the perspective of the DataSource. 

I know that I can parse values on the server side to try to guess the data type, as with the example applications, but that's not reliable in all cases, and I don't want to do that. It's better to know the field type based on the perspective of the widget.

Hopefully I'm just missing the DataSource configuration option to 'Include Field Data Types in Filtering Requests'. If that doesn't exist, please add it as an enhancement request, and let me know the most effective way to accomplish this that will work for all widget and data source combinations. I figured out that I can do this with a grid:

parameterMap: function (data, type) {
var fields = $("#grid").data("kendoGrid").dataSource.options.schema.model.fields;
var types = {};
for (let key in fields) {
types[key] = fields[key].type;
}
return $.extend({types}, data);
}

 

But I also have a Kendo Form with a form field edit of type MultiColumnComboBox, and the same approach will probably work, but I have to figure out how to get at the schema configuration in that case, and probably other combinations in the future.

2 comments
Travis Cotton
Posted on: 18 Nov 2021 15:45
Perfect. Thanks Veselin!
ADMIN
Veselin Tsvetanov
Posted on: 18 Nov 2021 11:19

Hi Travis,

The DataSource remote filter request data would contain field, operator, and value values. Having that said, the field type is not among the automatically picked data. Having that said, as per your request, I have converted the current thread to a feature request in our Feedback portal:

https://feedback.telerik.com/kendo-jquery-ui/1543325-include-field-data-types-in-server-request

As per the parameterMap() approach that would be applicable to each widget with a remote source binding. The parameterMap function is intended exactly for cases as discussed - to convert the request parameters to a format suitable for the remote service.

I hope the above answers your question. If you have any further queries on the Kendo widgets and their functionality, please do not hesitate to contact us.

Regards,
Veselin Tsvetanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.