combobox dropdown wont show

4 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 09 Jan 2013 Link to this post

    Ive just started using Kendo UI for the first time and I cant get the dropdown to show for a combobox.  Heres the code in the view

    <li>
                   @Html.LabelFor(m => m.UserRole)
                   @Html.Kendo().ComboBoxFor(m => m.UserRole).BindTo(Model.UserRoles).AutoBind(true).SelectedIndex(0).Suggest(true)
               </li>

    In debug ive checked the contents of Model.UserRoles  and there are currently 3 items.  But when the page displays, I see a normal text box, not a dropdown.  I have the required .js files and .css files loaded, so what am I doing wrong ?
  2. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 09 Jan 2013 Link to this post

    In Firebug console I get an error message

    'TypeError: jQuery("#UserRole").kendoComboBox is not a function'

    this is whats emitted to the html

    <li>
    <label for="UserRole">User role</label>
    <input data-val="true" data-val-required="The User role field is required." id="UserRole" name="UserRole" type="text" /><script>
    jQuery(function(){jQuery("#UserRole").kendoComboBox({"dataSource":["Agency","Artist","Venue"],"autoBind":true,"index":0,"suggest":true});});
    </script>
    </li> 

  3. Kendo UI is VS 2017 Ready
  4. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 11 Jan 2013 Link to this post

    Hi Mark,

    The most likely reason for this error it that some of the needed resources are missing. Could you please check if everything is correctly included? 
     
    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 11 Jan 2013 Link to this post

    I had exactly the same problem with a DropDownList and manged to resolve it myself in the end.  My layout page had the JQuery library linked at the bottom of the page, so it hadnt been loaded when it was being referenced.  Moving this to the top of the page fixed the problem

    @Scripts.Render("~/bundles/jquery")
Back to Top
Kendo UI is VS 2017 Ready