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

clientside - select tab w/o firing OnClientTabSelected

2 Answers 48 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
bozojoe
Top achievements
Rank 1
bozojoe asked on 01 Sep 2009, 11:54 PM
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 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 04 Sep 2009, 12:00 PM
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.
0
bozojoe
Top achievements
Rank 1
answered on 04 Sep 2009, 03:24 PM
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?
Tags
TabStrip
Asked by
bozojoe
Top achievements
Rank 1
Answers by
Paul
Telerik team
bozojoe
Top achievements
Rank 1
Share this question
or