2014-09-11 83 views
0

我想要使用自定義鏈接在不同的ContentPane上導航,該鏈接位於表格的左側(即屏幕x.x),如何做到這一點而不是使用默認的StackController。在dojo中創建自定義StackController

請隨時與我聯繫,謝謝。

<table> 
<tr> 
    <td> 
    <table border='1' cellspacing='5' cellpadding='5'> 
     <tr><th>Category 1</th><td>Screen 1.1</td></tr> 

     <tr><th rowspan='3'>Category 2</th><td>Screen 2.1</td></tr> 
     <tr><td>Screen 2.2</td></tr> 
     <tr><td>Screen 2.3</td></tr> 

     <tr><th rowspan='2'>Category 3</th><td>Screen 3.1</td></tr> 
     <tr><td>Screen 3.2</td></tr>    
    </table> 
    </td> 
    <td> 
     <div data-dojo-type="dijit.layout.StackController" data-dojo-props="containerId:'stackContainer'"></div> 
     <div data-dojo-type="dijit.layout.StackContainer" id="stackContainer"> 
      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0101' title="Screen 1.1"> 
       Categor 1 - Screen 1.1 
      </div> 

      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0201' title="Screen 2.1"> 
       Categor 2 - Screen 2.1 
      </div> 
      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0202' title="Screen 2.2"> 
       Categor 2 - Screen 2.2 
      </div> 
      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0203' title="Screen 2.3"> 
       Categor 2 - Screen 2.3 
      </div> 

      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0301' title="Screen 3.1"> 
       Categor 3 - Screen 3.1 
      </div> 
      <div data-dojo-type="dijit.layout.ContentPane" id='cnt_0302' title="Screen 3.2"> 
       Categor 3 - Screen 3.2 
      </div> 
     </div> 
    </td> 
    </tr> 

大家好,

我想用自定義鏈接,這是有左側的表(即屏幕XX)在不同的contentPane導航,我怎麼能做到這一點,而不是使用默認的StackController。

請隨時與我聯繫,謝謝。

回答

0
<script> 
function navigateTo(divContainer) 
{ 
    this.dijit.byId('stackContainer').selectChild(divContainer) 
} 
</script> 

selectChild()是其可以是使用導航到堆棧容器佈局不同容器的製造方法。