clientside - select tab w/o firing OnClientTabSelected

3 posts, 0 answers
  1. bozojoe
    bozojoe avatar
    2 posts
    Member since:
    Aug 2007

    Posted 01 Sep 2009 Link to this post

    I need to programmatically change the selected tab without causing the OnClientTabSelected event to fire.  Using both tab.select(); and tab.set_selected(true); is firing my event.
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 04 Sep 2009 Link to this post

    Hi bozojoe,

    Please find below a sample code snippet that shows the needed approach.

    <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
     
        <script type="text/javascript"
            function test() { 
                var tabstrip = $find('<%= RadTabStrip1.ClientID  %>'); 
                tabstrip.remove_tabSelected(OnClientTabSelected); 
                tabstrip.get_tabs().getTab(1).select(); 
                tabstrip.add_tabSelected(OnClientTabSelected); 
            } 
     
            function OnClientTabSelected(sender, args) { 
                alert("1") 
            }  
        </script> 
     
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnClientTabSelected="OnClientTabSelected"
            <Tabs> 
                <telerik:RadTab runat="server" Text="Signature and Bio"
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Email"
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Controls"
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <input id="Button1" type="button" value="button" onclick="test()" /> 
        </form> 


    Regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. bozojoe
    bozojoe avatar
    2 posts
    Member since:
    Aug 2007

    Posted 04 Sep 2009 Link to this post

    What can I do if I do not have the name or the event callback function?
    Is there a way to query the tabstrip to retrieve the function name?
Back to Top