对于Dhtmlx标签中的DhtmlxLayout的使用,(在特别的情况加需要隐藏掉那个折起按钮)
function DhtmlExtTools() {
}
//隐藏某个LAYOUT.CELL的折起按扭
DhtmlExtTools.prototype.hideLayoutCellButton=function(cellObj) {
cellObj.childNodes[0].childNodes[0].childNodes[4].style.display="none";
}
//显示某个LAYOUT.CELL的折起按扭
DhtmlExtTools.prototype.showLayoutCellButton=function(cellObj) {
cellObj.childNodes[0].childNodes[0].childNodes[4].style.display="";
}
//得到某个tabBar的 tab页个数
DhtmlExtTools.prototype.getTabCount=function(voTabbar) {
var i=0;
var count=0;
for (i=0;i<voTabbar._rows.length;i++) {
count+=voTabbar._rows[i].tabCount;
}
return count;
}
//得到某个tabBar活动页的内容
DhtmlExtTools.prototype.activeTabIframe=function (voTabbar) {
var actabid=voTabbar.getActiveTab();
return voTabbar.cells(actabid).content.vs[content.av]._frame;
}
//得到某个容器(window,layout.cell,tabbar.tab)的iframe
DhtmlExtTools.prototype.getContentIframe=function(content) {
return content.vs[content.av]._frame;
}
//得到指定长度的随机字符串
DhtmlExtTools.prototype.randomStr=function(strLen) {
var x="QWERTYUIPLKJHGFDSAZXCVBNM";
var tmp="";
for(var i=0;i<strLen;i++) {
tmp += x.charAt(Math.ceil(Math.random()*100000000)%x.length);
}
return tmp;
}
var dhtmlExtTools=new DhtmlExtTools();
//上面的代码是一个.js文件 需要的时候导入即可
//下面是就是 要隐藏的 dhtmlxLayout的使用该功能
<script>
function initLayout()
{
var mpRightLayout=new dhtmlXLayoutObject("layoutDiv","2E");
mpRightLayout.setEffect("resize", false);
mpRightLayout.setEffect("collapse", false);
mpRightLayout.setEffect("highlight", true); //很关键啊,要不然调大小有问题
mpRightLayout.setAutoSize("a,b", "a,b");
mpRightLayout.cells("a").setText("业务单据列表");
mpRightLayout.cells("b").setText("单据选用预算列表");
dhtmlExtTools.hideLayoutCellButton(mpRightLayout.cells("a"));隐藏>>
dhtmlExtTools.hideLayoutCellButton(mpRightLayout.cells("b"));
mpRightLayout.cells("a").attachURL("DjysxyDy.do?Fn=YwdjList",0); //单据列表
}
</script>