This is a migrated thread and some comments may be shown as answers.

Add item to splitbutton in toolbar

1 Answer 188 Views
Toolbar
This is a migrated thread and some comments may be shown as answers.
Owen
Top achievements
Rank 1
Owen asked on 18 May 2015, 10:02 PM

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?

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 20 May 2015, 02:01 PM

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
Tags
Toolbar
Asked by
Owen
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or