Kendo UI Dropdown update with parameter on button click

2 posts, 0 answers
  1. 100%
    100% avatar
    75 posts
    Member since:
    Apr 2013

    Posted 05 Nov 2015 Link to this post

    I'm trying to update a Kendo UI dropdownlist programmatically when pressing a button.

    Main dropdown:


              .DataSource(source =>
              source.Read(read =>
                     read.Action("GetLayoutTemplatesDropdown", LayoutTemplate");
               <button class="loadLayout" type="button">Load</button>

    Second dropdownlist:

               .OptionLabel("Choose one")
               .Template("<span class=\"glyphicon glyphicon-font\"></span> #:data.Text#")
               .DataSource(source =>
                   source.Read(read =>
                       read.Action("GetTemplateCSSTemplatesDropdown", "TemplateCSSTemplate")



    function filterTemplateCSSTemplates() {
                return {
                    layoutTemplateID: $("#LayoutTemplate").val()
         $(".loadLayout").on("click", function (e) {
                 var layoutTemplateID = $("#LayoutTemplate").val();
                 if (layoutTemplateID) {  

    Goal is:

    When $(".loadLayout") is clicked refresh "CreateTemplateCSS" with the "layoutTemplateID" parameter. 

    How can I adjust this to make it work?

  2. Georgi Krustev
    Georgi Krustev avatar
    3689 posts

    Posted 09 Nov 2015 Link to this post


    I would suggest you force the widget to re-load its data on button click. You can do that using read method of the datasource:
    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