Add item to splitbutton in toolbar

2 posts, 0 answers
  1. Owen
    Owen avatar
    2 posts
    Member since:
    Oct 2014

    Posted 18 May 2015 Link to this post

    I can't seem to find any examples of adding a menu item to a splitbutton in a toolbar.  

    Here is the code I have for the splitbutton:

            $("#toolbar").kendoToolBar({
                items: [
                    {
                        type: "splitButton",
                        text: "Select",
                        id: "selectButton",
                        click: selectButtonClickHandler,
                        menuButtons: [
                            { text: "foo1" },
                            { text: "foo2" }
                        ]
                    }

                 ]
            });

    I'm trying to do something like $("#selectButton").add(new menuButton("foo3"));

    Is there a way to do this?  How have I missed it in the documentation?

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 20 May 2015 Link to this post

    Hi Owen,

    There is no official API method for this requirement. What I would suggest as a workaround is to use jQuery append method and manually add a new item to the list: 

    $("#selectButton_optionlist").append("<li><a class='k-button'>Foo3</a></li>");

    Regards,
    Iliana Nikolova
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top