2016-06-07 54 views
1

我想實現這樣的事情在發生反應,用react-bootsraphttp://www.bootply.com/T0v2NlXryW擴大排反應,引導

我現在做出反應的代碼是這樣,但不工作:

<Table> 
<thead> 
    <tr> 
     <th>Job Name</th> 
     <th>Description</th> 
     <th>Provider Name</th> 
     <th>Region</th> 
     <th>Status</th> 
    </tr> 
</thead> 
<tbody> 
    <tr data-toggle="collapse" data-target="#demo1" className="accordion-toggle"> 
     <td>OBS Name</td> 
     <td>OBS Description</td> 
     <td>hpcloud</td> 
     <td>nova</td> 
     <td> created</td> 
    </tr> 
    <tr> 
     <td colspan="12" className="hiddenRow"> 
      <div className="accordian-body collapse" id="demo1"> 
       <h1>Hi from the hiddenRow</h1> 
      </div> 
     </td> 
    </tr> 
</tbody></Table> 

表格顯示正確,但行不會在點擊時展開。

回答

0

您的代碼正在爲我工​​作 - 隱藏的行在點擊時切換。看看這個Bootply:http://www.bootply.com/QZPe6DSp1F

也許你沒有加載JQuery?

+0

對不起,也許我不夠清楚,但我正在使用React – ilbonte

+1

Bootstrap的JavaScript的東西取決於jQuery – ajma

0

現在它變得容易多了,因爲Bootstrap實現了摺疊功能。看here