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

Client-side programming question

4 Answers 85 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 24 Jun 2008, 07:03 PM
I have a RadToolbarSplitButton that has a DefaultButtonIndex pointing to one of the child buttons. The buttons are disabled by default until the page has finished loading in order to prevent the user from performing an action before the page is ready to handle it.

To enable the buttons, I have some client script that executes in the Ajax pageLoad method and the buttons are enabled conditionally depending on the circumstances surrounding the opening of the page (i.e. if the record is opened in readonly mode, then only certain buttons are enabled).

We have unique values for each button, but when we use findItemByValue to locate the buttons to enable, the default button (the one visible on the toolbar) is enabled, but the corresponding button in the dropdown list is disabled.

We either need a way to find all items with the same value or (preferrably) the item that we find with findItemByValue would apply its enabled state to all instances of the button. Does anyone know a way to accomplish this?

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 25 Jun 2008, 01:21 PM
Hi Karl,

We did a simple test, but everything worked as expected:
<asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
 
    <script type="text/javascript">  
    function pageLoad()  
    {  
        var toolbar1=$find("<%=RadToolBar1.ClientID%>")         
        var ddButton2 = toolbar1.findItemByValue("ddTwo");          
        ddButton2.enable();  
    }      
    </script> 
 
    <telerik:RadToolBar ID="RadToolBar1" runat="server">  
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        <Items> 
            <telerik:RadToolBarDropDown runat="server" Text="DropDown 0">  
                <Buttons> 
                    <telerik:RadToolBarButton runat="server" Text="Child Button 1">  
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton runat="server" Value="ddTwo" Enabled="false" Text="Child Button 2">  
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton runat="server" Text="Child Button 3">  
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton runat="server" Text="Child Button 4">  
                    </telerik:RadToolBarButton> 
                </Buttons> 
            </telerik:RadToolBarDropDown> 
        </Items> 
    </telerik:RadToolBar> 

How is your case different than the above test sample? Could you please send us the code of your implementation?


Regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Louis
Top achievements
Rank 1
answered on 26 Jun 2008, 03:16 AM
The primary difference that I see is that you have use a RadToolBarDropDown whereas the problem I had was with RadToolBarSplitButton with a DefaultButtonIndex set to 0 and the 0th button disabled. I don't have time to test this right now, but I suspect that you will find that this causes the problem.
0
Peter
Telerik team
answered on 27 Jun 2008, 02:53 PM
Hi Karl,

Aplogies for misunderstanding the exact scenario under which the problem can be observed. Now, I was able to verify that the problem really exists, so I have logged it and our developers will address it shortly.


Thanks!

Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Erjan Gavalji
Telerik team
answered on 01 Jul 2008, 03:07 PM
Hi Karl,

The bug is already fixed. Please, open a formal support ticket and specify the .NET version you use to obtain the dev build.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolBar
Asked by
Louis
Top achievements
Rank 1
Answers by
Peter
Telerik team
Louis
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Share this question
or