I wanted to delete a pane from sliding zone but I didn't see any functionality that lets you directly do this
on the client side (javascript). There is a HideTab() method in the sliding pane but this doesn't really help
my cause because I have to make sure the pane is deleted. Can somebody show me how to appropriately
delete a pane from sliding zone on Client side? This is the closest i got to deleting a tab pane:
function deleteTab(TabName)
{
var slidingZone = $find("<%= TreeSlidingZoneLeft.ClientID %>");
var slidingPane = FindTabPaneByTitle(TabName);
if(slidingPane != null)
{
slidingZone.UndockPane(slidingPane.get_id());
slidingPane.getTabContainer().removeNode(slidingPane);
slidingPane.getContentContainer().removeNode(slidingPane);
ArrayRemove(slidingZone._slidingPanes, index);
slidingPane.HideTab();
}
}
function ArrayRemove(array, from, to) {
var rest = array.slice((to || from) + 1 || array.length);
array.length = from < 0 ? array.length + from : from;
return array.push.apply(array, rest);
};
function FindTabPaneByTitle(TabName)
{
var slidingPanes = getPanes();
var slidingPane = null;
for (var i = 0; i < slidingPanes.length; i++)
{
container = slidingPanes[i].GetTabContainer();
if(container.title.toLowerCase() == TabName.toLowerCase())
{
index = i;
slidingPane = slidingPanes[i];
break;
}
}
return slidingPane;
}
function getPanes()
{
var slidingZone = $find("<%= TreeSlidingZoneLeft.ClientID %>");
return slidingZone.getPanes();
}
Thanks,
James