Posted 8/24/2007 1:00:17 AM | | | | I've set up my TabBar thus: ITabBar objTabBar = ControlFactory.CreateTabBar(); objTabBar.ID = "objTabBar"; objTabBar.ClientSideAfterChangeHandler = "ChangeTab"; Now in ChangeTab() I want to discover which tab lost focus or was clicked. |
| Posted 8/28/2007 10:21:21 AM | | | On the client side you can use javascript to determine which tab is selected.
What you need to do is to check if the tabItem element on the page has the 'tabOn' string in the className attribute...(just love the IE Developer ToolBar...)
I have attached a slightly altered (old?) c360 exercise page which has some javascript that does so:
The code that shows is in the Change() javascript method that looks like this:
function Change()
{
var tabItem = document.getElementById("tab0");
var tabControl = document.getElementById("TabBar");
alert("Is North selected? " + IsC360TabBarItemSelected(tabItem));
var tabItems = getC360TabBarItems(tabControl)
for (i=0;i<tabItems.length;i++)
{
if (IsC360TabBarItemSelected(tabItems[i]))
alert(tabItems[i].title + " is selected.");
}
}
|
| Posted 8/28/2007 10:48:30 AM | | | pklingens (8/28/2007) On the client side you can use javascript to determine which tab is selected.
What you need to do is to check if a tabItem element on the page has the 'tabOn' string in the className attribute...(just love the IE Developer ToolBar...)
I have attached a slightly altered (old?) c360 exercise page which has some javascript that does so:
....
Oeps, just noticed the document.GetElementById("tab0") does not return the right tabItem element ...
Updated this in the attachment with this post.
In addition using the javascript posted in the attachment you can also select a tab doing:
var tabItem = getC360TabBarItemByCaption("TabBar", "North")
tabItem.click();
|
| |
|