New to Kendo UI for jQueryStart a free 30-day trial

Close the ToolBar Popup Manually

Environment

ProductProgress® Kendo UI® ToolBar for jQuery
Operating SystemWindows 10 64bit
Visual Studio VersionVisual Studio 2017
Preferred LanguageJavaScript

Description

How can I manually close the popup of a Kendo UI for jQuery ToolBar?

Solution

The example below demonstrates how to close the ToolBar popup from a button click event in a template.

   <div id="toolbar"></div>
    </div>

  <script>
    function action() {
      $("#toolbar").data("kendoToolBar").popup.close();
    }

    $("#toolbar").kendoToolBar({
      items: [
        { type: "button", text: "Button" },
        {
          template:"<a class='k-item k-state-default ng-scope' >Test</a>",
          overflowTemplate:"<button onclick='action()' class='btn' >Test</button>",
          overflow: "always"
        }
      ]
    });
  </script>

See Also