ToolBar JSP Tag Overview

The ToolBar JSP tag is a server-side wrapper for the Kendo UI ToolBar widget.

Getting Started


The example below demonstrates how to initialize the ToolBar and also its basic usage.

  <kendo:toolBar name="toolbar">

          <!-- regular button -->
          <kendo:toolBar-item type="button" text="Button"></kendo:toolBar-item>

          <!-- toggle button -->
          <kendo:toolBar-item type="button" togglable="true" text="Toggle Button"></kendo:toolBar-item>

          <!-- split button -->
          <kendo:toolBar-item type="splitButton" text="Split Button">
                  <kendo:toolBar-item-menuButton text="Option 1" id="option1"></kendo:toolBar-item-menuButton>
                  <kendo:toolBar-item-menuButton text="Option 2" id="option2"></kendo:toolBar-item-menuButton>
                  <kendo:toolBar-item-menuButton text="Option 3" id="option3"></kendo:toolBar-item-menuButton>

          <!-- button group -->
          <kendo:toolBar-item type="buttonGroup">
                  <kendo:toolBar-item-button text="Left" togglable="true" group="text-align" spriteCssClass="k-tool-icon k-justifyLeft"></kendo:toolBar-item-button>
                  <kendo:toolBar-item-button text="Center" togglable="true" group="text-align" spriteCssClass="k-tool-icon k-justifyCenter"></kendo:toolBar-item-button>
                  <kendo:toolBar-item-button text="Right" togglable="true" group="text-align" spriteCssClass="k-tool-icon k-justifyRight"></kendo:toolBar-item-button>

          <!-- separator -->
          <kendo:toolBar-item type="separator"></kendo:toolBar-item>

          <!-- custom template -->
          <kendo:toolBar-item template="<input id='dropdown' style='width: 150px' />" overflow="never"></kendo:toolBar-item>



Below are listed the steps for you to follow when configuring the Kendo UI ToolBar.

Step 1 Make sure you followed all the steps from the introductory article on Telerik UI for JSP.

Step 2 Create a new action method.

    @RequestMapping(value = {"index"}, method = RequestMethod.GET)
    public String index() {

        return "web/window/index";

Step 3 Add the Kendo UI taglib mapping to the page.

    <%@taglib prefix="kendo" uri=""%>

Step 4 Add a toolbar tag and specify the widget controls.

  <kendo:toolBar name="toolbar">
          <kendo:toolBar-item type="button" text="Button"></kendo:toolBar-item>

For more information on the supported command types, refer to this link.

Event Handling

Subscribe to Events

You can subscribe to all events exposed by Kendo UI ToolBar by the handler name.

  <kendo:toolBar name="toolbar" click="onClick" toggle="onToggle"></kendo:toolBar>
      function onClick(e) {
          //Handle the click event



Existing Instances

You are able to reference an existing ToolBar instance via the Once a reference is established, you are able to use the ToolBar API to control its behavior.

  // Put this after your Kendo ToolBar tag declaration
  $(function() {
      var toolbar = $("#container").data("kendoToolBar");

See Also

In this article