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

can't set/search default dropdown value

1 Answer 171 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 23 Feb 2013, 10:57 PM
I'm using the following

.DropDownListFor(m => m.countryId)
            .DataSourceAction("GetSomething")
            .DataSourceController("SomethingMethod")
            .IsEnabled(true)
            .Name("Something")
            .OptionLabel(this.LocalResources("OptionSelect"))
            .ServerFiltering(true))

I'm trying to use the search / select functions on the dropdown but when I do a console log of the dropdownlist obj I don't see it in there

e.extend.init {elementp.fn.p.init[1]_eventsObjectoptionsObjecttemplatefunctionulp.fn.p.init[1]}
  1. _arrowp.fn.p.init[1]
  2. _busynull
  3. _currentp.fn.p.init[1]
  4. _eventsObject
  5. _fetchfalse
  6. _focusedp.fn.p.init[1]
  7. _inputWrapperp.fn.p.init[1]
  8. _old""
  9. _oldIndex0
  10. _refreshHandlerfunction (){return a.apply(c,e.concat(k.call(arguments)))}
  11. _requestStartHandlerfunction (){return a.apply(c,e.concat(k.call(arguments)))}
  12. _textfunction anonymous(d) {
  13. _touchScrollerfalse
  14. _valuefunction anonymous(d) {
  15. _word""
  16. dataSourceo.extend.init
  17. elementp.fn.p.init[1]
  18. listp.fn.p.init[1]
  19. optionsObject
  20. popupe.extend.init
  21. selectedIndex0
  22. spanp.fn.p.init[1]
  23. templatefunction anonymous(data) {
  24. ulp.fn.p.init[1]
  25. wrapperp.fn.p.init[1]
  26. __proto__b
  27. var dropdownlist = $("#country").data("kendoDropDownList"); dropdownlist.select("United States");
    TypeError: Object United States has no method 'hasClass'
    1. argumentsArray[2]
    2. get messagefunction () { [native code] }
    3. get stackfunction () { [native code] }
    4. set messagefunction () { [native code] }
    5. set stackfunction () { [native code] }
    6. type"undefined_method"
    7. __proto__Error

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 25 Feb 2013, 08:39 AM
Hello Phil,

 
The DropDownList widget has select method, but it accepts Integer, DOM element and predicate. It does not support string parameter. I will suggest check the documentation for more information.

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