我有一个应用程序,它使用dijit.layout.AccordionContainer和两个“子容器”
在加载映射时,默认情况下其中一个容器是打开的。我希望默认容器关闭,第二个容器在单击按钮时打开。知道怎么做吗?
我尝试过使用selectChild()方法,但肯定是做错了,否则根本就不正确。
编辑我的是:
<div dojotype="dijit.layout.ContentPane" id="leftPane" region="left" splitter="true">
<div dojotype="dijit.layout.AccordionContainer">
<div dojotype="dijit.layout.ContentPane" title="Table of Contents">
<div id="tocDiv">
</div>
</div>
<div dojotype="dijit.layout.ContentPane" title="Search Results" id="tab2">
<div id="datagrid">
<table data-dojo-type="dojox.grid.DataGrid" data-dojo-id="grid" id="grid" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field="Parcel Identification Number" width="25%">
Parcel ID
</th>
<th field="Site Address" width="30%">
Address
</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>在这里,我试图打开"tab2“的点击,通过我为其他一些事情创建的函数,我需要在点击
联署材料:
function doFind() {
//Set the search text to the value in the box
findParams.searchText = dojo.byId("parcel").value;
grid.showMessage("Loading..."); //Shows the Loading Message until search results are returned.
findTask.execute(findParams,showResults);
}发布于 2013-02-26 18:30:49
你离我很近。
我假设您正在收听您自己的按钮单击事件。如果你不能,如果可以的话,请把代码的那一部分张贴出来。
如果是这样,那么您需要这样做:
<accordian-container>.selectChild( <pane to open>);您需要将窗格传递给selectChild方法。
手风琴容器是一种堆栈容器,因此这个文档应该有帮助:
http://dojotoolkit.org/reference-guide/1.8/dijit/layout/StackContainer.html
这里有一个链接,指向Stackoverflow上的几乎相同的问题:Whats the best way to programatically open a pane inside Dijit AccordionContainer
https://stackoverflow.com/questions/15114373
复制相似问题