Client-side programming question

5 posts, 0 answers
  1. Louis
    Louis avatar
    23 posts
    Member since:
    Feb 2006

    Posted 24 Jun 2008 Link to this post

    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?
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 Jun 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Louis
    Louis avatar
    23 posts
    Member since:
    Feb 2006

    Posted 25 Jun 2008 Link to this post

    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.
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 27 Jun 2008 Link to this post

    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
  6. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 01 Jul 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017