[英]Mixing a Table with Angular-UI Accordion
我正在嘗試將一張桌子與angular-ui的手風琴混合在一起,但我無法想出辦法。 我不是專業人士,寫指令。 我想知道這座橋是否存在。 要實現這樣的目標:
<table class="table table-hover table-condensed" thead>
<thead>
<tr>
<th>{{ data.profile.firstname }}</th>
<th>{{ data.profile.lastname }}</th>
<th>{{ data.profile.email }}</th>
<th>{{ data.profile.company_name }}</th>
<th>{{ data.profile.city }}</th>
</tr>
</thead>
<tbody accordion close-others="true">
<!-- <tr ng-repeat="client in clients" ng-click="goTo('profile/' + client.username);"> -->
<tr ng-repeat="client in clients" accordion-group is-open="client.isOpen">
<accordion-heading>
<td>{{ client.firstname }}</td>
<td>{{ client.lastname }}</td>
<td>{{ client.email }}</td>
<td>{{ client.company_name }}</td>
<td>{{ client.city }}</td>
</accordion-heading>
Accordion Content
</tr>
</tbody>
</table>
雖然它不起作用:(是否有人成功實現了這樣的目標?
我正在尋找的結果是,當我點擊表格中的一行時,它會產生與手風琴相同的行為。
在我的情況下,我使它有點原始,但也許這對你來說也是一個很好的解決方案。 看:
<tbody ng-repeat="person in people | orderBy:predicate:reverse" >
<tr ng-click="isOpen=!isOpen">
<td>{{person.name}}</td>
<td>{{person.job}}</td>
<td>{{person.age}}</td>
<td>{{person.grade}}</td>
</tr>
<tr ng-if="isOpen">
<td>Just an empty line</td>
</tr>
</tbody>
1)你可以嘗試使用div
代替table
作為主手風琴。 這個對我有用。
2)這里是accordion
table
下面的jsfiddle做例子,我希望它會幫助你。 http://jsfiddle.net/Pixic/VGgbq/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.