Kendo ComboBox virtualization with OData

6 posts, 0 answers
  1. Ivan
    Ivan avatar
    5 posts
    Member since:
    Nov 2015

    Posted 17 Nov 2015 Link to this post

    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? 

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 19 Nov 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Ivan
    Ivan avatar
    5 posts
    Member since:
    Nov 2015

    Posted 19 Nov 2015 in reply to Georgi Krustev Link to this post

    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.

     

     

  5. Ivan
    Ivan avatar
    5 posts
    Member since:
    Nov 2015

    Posted 19 Nov 2015 Link to this post

    P.S. The editing is broker on your site (formatting options ant etc)
  6. Ivan
    Ivan avatar
    5 posts
    Member since:
    Nov 2015

    Posted 19 Nov 2015 Link to this post

    *broken
  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 23 Nov 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready