0

2 つの「子コンテナー」で dijit.layout.AccordionContainer を使用するアプリがあります。

マップが読み込まれると、コンテナの 1 つがデフォルトで開かれます。ボタンがクリックされたときにデフォルトのコンテナを閉じて、2 番目のコンテナを開くようにしたいと思います。これを行う方法はありますか?

selectChild() メソッドを使用してみましたが、間違っているか、完全にベースから外れているに違いありません。

編集 私のHTMLは次のとおりです。

<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」を開こうとしています

JS:

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);
      }
4

1 に答える 1

3

あなたはかなり近いです。

独自のボタン クリック イベントをリッスンしていると想定しています。可能であれば、コードのそのセクションを投稿してください。

もしそうなら、あなたはこれをする必要があります:

<accordian-container>.selectChild( <pane to open>);

ペインを selectChild メソッドに渡す必要があります。

アコーディオン コンテナーはスタック コンテナーの一種であるため、次のドキュメントが役立ちます。

http://dojotoolkit.org/reference-guide/1.8/dijit/layout/StackContainer.html

Stackoverflow に関するほぼ同じ質問へのリンクを次に示します

于 2013-02-26T18:30:49.643 に答える