RadTabStrip provides a flexible client-side API. You can easily interact with the
tabstrip in the browser using the tabstrip client-side object.
- Getting the RadTabStrip client-side object. RadTabStrip creates a client-side object
with the ClientID of the tabstrip. You can obtain the reference using the following
javascript code:
var tabStrip = $find("<%=RadTabStrip1.ClientID%>");
- Once you get the client-side object of RadTabStrip, you can use the findTabByText
/ findTabByValue methods to get the instance of a particular tab. Example:
var tabStrip = $find("<%=RadTabStrip1.ClientID%>");
var text = $get("openTextBox").value;
var tab = tabStrip.findTabByText(text);
- When you get the instance of a particular tab, you can call the select()
method:
function selectTab()
{
var tabStrip = $find("<%= RadTabStrip1.ClientID %>");
var text = $get("<%= TextBox1.ClientID %>").value;
var tab = tabStrip.findTabByText(text);
if (!tab)
{
alert("There is no tab with text \"" + text + "\"");
return false;
}
tab.set_selected(true); //The same as tab.select();
return false;
}
You can also select a pageview, like
function selectPageView()
{
var pageView = $find("<%= RadMultiPage1.ClientID %>");
var pageViewIndex = parseInt ($get("<%= DropDownList1.ClientID %>").value);
pageView.get_pageViews().getPageView(pageViewIndex).set_selected(true);
return false;
}