dojo中AccordionContainer(手风琴)动态添加ContentPane
发布时间:2020-12-16 21:24:05 所属栏目:百科 来源:网络整理
导读:dojo的api案例中也有类似的添加方法,但是在实际中需要稍作修改,其中html中代码如下: div dojoType="dijit.layout.ContentPane" style="width: 100%;height: 100%;" dojoAttachPoint="contenPaneDiv"div dojoAttachPoint="accor" style="height: 100%;widt
dojo的api案例中也有类似的添加方法,但是在实际中需要稍作修改,其中html中代码如下: <div dojoType="dijit.layout.ContentPane" style="width: 100%;height: 100%;" dojoAttachPoint="contenPaneDiv"> <div dojoAttachPoint="accor" style="height: 100%;width :100%;" dojoType="dijit.layout.AccordionContainer" id="${id}_accordion"> </div> </div> js文件中需要添加引用: dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.AccordionContainer"); 添加方法如下: //testTitle 模块的标题 var content = new dijit.layout.ContentPane({id:id,style:"padding:0px;height:100%;",title:"testTitle"}); content.startup(); this.accor.addChild(content); this.accor.startup(); this.accor.resize();//如果不执行此方法,会出现显示异常的情况 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |