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

valueMapper not working with Dropdownlist

1 Answer 787 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jackie
Top achievements
Rank 1
Jackie asked on 19 Jan 2016, 03:14 AM

Hi,

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) {
                            alert("ok");
                        }
                    },
                    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

1 Answer, 1 is accepted

Sort by
-1
Georgi Krustev
Telerik team
answered on 21 Jan 2016, 08:27 AM
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.


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
DropDownList
Asked by
Jackie
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or