function carltbl_getBandById(tagId)
{
if(!tagId)
return null;
var parts = tagId.split("_");
var bandIndex = parts.length - 2;
var gridId = parts[0];
var el=carltbl_getElementById(tagId);
if((gridId.charAt(gridId.length-3)=="g" &&
gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="c" || gridId.charAt(gridId.length-3)=="s" &&
gridId.charAt(gridId.length-2)=="g" &&
gridId.charAt(gridId.length-1)=="r") &&
el && el.getAttribute("groupRow"))
{
gridId=gridId.substr(0,gridId.length-3);
bandIndex--;
}
else if(el && (gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="c" &&
el.tagName=="TD" || gridId.charAt(gridId.length-2)=="g" &&
gridId.charAt(gridId.length-1)=="r" &&
el.getAttribute("groupRow") || gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="h" &&
el.getAttribute("hiddenRow")))
{
gridId=gridId.substr(0,gridId.length-2);
bandIndex--;
}
else if(gridId.charAt(gridId.length-1)=="r" && el && el.tagName=="TR")
gridId=gridId.substr(0,gridId.length-1);
else if(gridId.charAt(gridId.length-1)=="c" && el && el.tagName=="TH")
{
gridId=gridId.substr(0,gridId.length-1);
bandIndex=parts[1];
}
else
return null;
if(!carltbl_getGridById(gridId))
return null;
var grid = carltbl_getGridById(gridId);
return grid.Bands[bandIndex];
}
{
if(!tagId)
return null;
var parts = tagId.split("_");
var bandIndex = parts.length - 2;
var gridId = parts[0];
var el=carltbl_getElementById(tagId);
if((gridId.charAt(gridId.length-3)=="g" &&
gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="c" || gridId.charAt(gridId.length-3)=="s" &&
gridId.charAt(gridId.length-2)=="g" &&
gridId.charAt(gridId.length-1)=="r") &&
el && el.getAttribute("groupRow"))
{
gridId=gridId.substr(0,gridId.length-3);
bandIndex--;
}
else if(el && (gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="c" &&
el.tagName=="TD" || gridId.charAt(gridId.length-2)=="g" &&
gridId.charAt(gridId.length-1)=="r" &&
el.getAttribute("groupRow") || gridId.charAt(gridId.length-2)=="r" &&
gridId.charAt(gridId.length-1)=="h" &&
el.getAttribute("hiddenRow")))
{
gridId=gridId.substr(0,gridId.length-2);
bandIndex--;
}
else if(gridId.charAt(gridId.length-1)=="r" && el && el.tagName=="TR")
gridId=gridId.substr(0,gridId.length-1);
else if(gridId.charAt(gridId.length-1)=="c" && el && el.tagName=="TH")
{
gridId=gridId.substr(0,gridId.length-1);
bandIndex=parts[1];
}
else
return null;
if(!carltbl_getGridById(gridId))
return null;
var grid = carltbl_getGridById(gridId);
return grid.Bands[bandIndex];
}