SplitButton by Value equivalent?

2 posts, 0 answers
  1. Joshua
    Joshua avatar
    78 posts
    Member since:
    Sep 2008

    Posted 19 Dec 2011 Link to this post

    In javascript, I'm using .findButtonByValue('value').

    However, how do I find a split button, especially since there's no 'value' property of the SplitButton?

  2. Bozhidar
    Bozhidar avatar
    1180 posts

    Posted 20 Dec 2011 Link to this post

    Hi Joshua,

    To get the split button, you can use the following approach:

    1. Set a custom attribute to the SplitButton. For example:

    <telerik:RibbonBarSplitButton SplitButtonValue="SplitButton1" Size="Medium" Text="Button" ImageUrl="~/Img.jpg" />

    2. Now you can find the button with the following function:
    function findSplitButton(buttonValue){
        var ribbon = $find("RadRibbonBar1");
        for (var i = 0; i < ribbon.get_tabs().get_count(); i++) {
            var tab =  ribbon.get_tabs().getTab(i);
            for (var j = 0; j < tab.get_groups().get_count(); j++) {
                var group = tab.get_groups().getGroup(j)
                for (var k = 0; k < group.get_items().get_count(); k++) {
                    var item = group.get_items().getItem(k);
                    var customAttribute = item.get_element().getAttribute('SplitButtonValue')
                    if(customAttribute != null && customAttribute == buttonValue){

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top