valueMapper not working with Dropdownlist

2 posts, 0 answers
  1. Jackie
    Jackie avatar
    1 posts
    Member since:
    Apr 2015

    Posted 18 Jan 2016 Link to this post


    I'm working on loading over 10000 items with Kendo UI Dropdownlist, I want to use the configuration "virtualization"  to implement virtual scrolling paging, the code as below:

    dropDownList = $("#sel_containers").kendoDropDownList({
                        dataTextField: "containerId",
                        dataValueField: "ident",
                        filter: "contains",
                        virtual: {
                            itemHeight: 26,
                            valueMapper: function (options) {
                        height: 400,
                        dataSource: {
                            type: "odata-v4",
                            transport: {
                                read: gms.App.getApiBaseUrl() + "odata/HistoryViews",
                                data: {
                                    $select: "ident,containerId",
                                    $orderby: "containerId asc",
                            pageSize: 100,
                            serverPaging: true,
                            serverFiltering: true

    But the alert(...) function did not work when the dropdownlist has been loaded completely., that means valueMapper function did not be invoked.

     Also I got a question about valueMapper, does this function need to return the index of the selected item?


    Please help me with this issue that why valueMapper not working for me.


    Thank you very much

  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 21 Jan 2016 Link to this post

    Hello Jackie,

    I already answered to the support thread opened on the same subject. I would like to ask you to keep the discussion in only one thread to avoid duplication. Thank you in advance for the cooperation.

    As to the discussed issue, here is a quote of the answer posted in the support thread:

    The valueMapper function will be called only if the widget needs to pre-select an item from the source:
    I would suggest you check our online demo and API documentation that will help you configure the widget in the desired way.

    If you are experiencing any difficulties, then I will ask you to send us a repro demo. Thus we will be able to review the issue locally and advice you further.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top