I have a Tab strip with multiple tabs. Each tab has a number of named controls\elements.
I want to be programaticaly select the tab which contains a specific control\element name.
function
setTabIndev(tabStripName, iTab, ctrHighlight)
{
if
($(
'#'
+ tabStripName).length)
{
var
tabStrip = $(
'#'
+ tabStripName).data(
'kendoTabStrip'
);
//If 'ctrHighlight' is set then find tab control is on and select that tab else use 'iTab'
if
(ctrHighlight && $(
'#'
+ ctrHighlight).length) {
}
else
{
if
(itab)
tabStrip.select(iTab);
}
}
}
5 Answers, 1 is accepted
Hello Tyler,
Please check this example.
Regards,Petyo
Telerik
Unfortunately this dosnt work because I have a TabStrip control with multiple tabStrips. Each tabStrip can contain one or more PanelBar controls and the index is returning for the PanelBar index the control is on and not the tabStrip index.
I'm guessing I need to refine the closest selector something like below but this dosnt work?
var
tabIndex = ts.find(
".k-content[role='tabpanel']"
).index(ts.find(
"#myControlToLookFor"
).closest(
".k-content"
));
The selector to get the tab index where there are tabStrips and panelBars mixed is as follows:
var
tabIndex = ts.find(
".k-content[role='tabpanel']"
).index(ts.find(
"#"
+ key).closest(
".k-content[role='tabpanel']"
));
Hello Tyler,
I am not sure if you need further assistance with your setup. If this is so, may you please modify the sample I provided, so that it matches your case more closely? Thank you in advance.
Regards,
Petyo
Telerik