This is a migrated thread and some comments may be shown as answers.

Kendo ComboBox virtualization with OData

5 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 17 Nov 2015, 11:31 AM

Hello. I'd like to know how to implement virtual scrolling for my ComboBox. I'm using OData for ComboBox's DataSource.

I've tried to use the example (https://demos.telerik.com/kendo-ui/combobox/virtualization) - however i'm stuck. I don't know how to implement a Value Mapper in my WebAPI. In this example it's easy to get the index of some value, which is not loaded yet, because there are no any filters/‚Äčordering ‚Äčthere. But in my case, i'm using the same OData method for different DataSources, but with different filters/ordering.

So, how can i get the index of some value, if i don't know which filter/ordering was used for the DataSource? 

5 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 19 Nov 2015, 08:58 AM
Hello Ivan,

I would suggest you first examine our documentation and particularly the valueMapper paragraph: Once you know what the valueMapper is required for, you can check our online demo: Consists the implementation of both the Read Action and the value -> index mapping. If you would like to see another implementation, please refer to out services project, used in the Kendo UI demos:
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Ivan
Top achievements
Rank 1
answered on 19 Nov 2015, 11:00 AM

Hi, Georgie. Thank you for your reply. I've read all of your links and i still have a question.
I know what the Value Mapper is needed for. It should return the row number of an item, that should be selected in the Combobox. That's Ok. However, to get the row number, i should know the appropriate sequence, in which i should search for the item. But in my case (as i mentioned before), i can not get the appropriate sequence, because i don't know which filter and ordering will be used. I mean different filters could give different rows amount and depending on ordering, the item could be, for example 1-st in the sequence or 1000-th.

 

 

0
Ivan
Top achievements
Rank 1
answered on 19 Nov 2015, 11:01 AM
P.S. The editing is broker on your site (formatting options ant etc)
0
Ivan
Top achievements
Rank 1
answered on 19 Nov 2015, 11:01 AM
*broken
0
Georgi Krustev
Telerik team
answered on 23 Nov 2015, 09:41 AM
Hello Ivan,

You are absolutely right, that the row index will be different when the source in the widget is filtered and/or sorted. What you can do is to send the filter/sort information to your service and based on it to determine the correct row index. Basically, you will need to filter/sort the data and then determine the row index.

You can retrieve the filter/sort expressions using the corresponding datasource API: As the developer is responsible for requesting its "valueMapper" service manually, he/she needs to send the additional filter/sort information along with the selected value.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Ivan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ivan
Top achievements
Rank 1
Share this question
or