The UI I want looks like this:
some_key a_column another_column
-------------------- -------- --------------
Main Row 2 3
. Child Row 2 3
. Second Child Row 2 3
Another Main Row 2 3
. Child Row 2 3
I'd do some ng:show affordance on the top level row to expand collapse the child rows, in tree-table style.
With tables (ignoring css), this would look like:
<table>
<tr> <td> Main Row </td> <td>2</td> <td>3</td> </tr>
<tr> <td> Child row </td> <td>2</td> <td>3</td> </tr>
<tr> <td> Second child row </td> <td>2</td> <td>3</td> </tr>
<tr> <td> Another Main Row </td> <td>2</td> <td>3</td> </tr>
<tr> <td> Child row </td> <td>2</td> <td>3</td> </tr>
The Problem is my data, and how that would naturally work with Angular:
items = [{
some_key:'Main Row',
a_column:'2',
another_column:'3',
examples:[
{
some_key: "Child Row",
a_column: "2",
another_column: "3"
},
{
some_key: "Second child Row",
a_column: "2",
another_column: "3"
}
]
}]
I can't do this in Angular :
<table>
<div ng:repeat="item in items">
<tr> <td> {{item.some_key}} </td> <td> {{item.a_column}} </td> <td> {{item.another_column}} </td> </tr>
<tr ng:repeat="ex in item.examples"> <td> {{ex.some_key}} </td> <td> {{ex.a_column}} </td> <td> {{ex.another_column}} </td> </tr>
</div>
</table>
I can't do it, because the HTML isn't valid for interspersed DIV tags amongst table rows. I could migrate to something table-less like
http://chrismaxwell.com/tableless/example.html but I wonder if there is a contrived element that could exist in an Angular page for the same of XML completeness, but is removed from the consequential DOM mutations:
<table>
<remove_me ng:repeat="item in items">
<tr> <td> {{item.some_key}} </td> <td> {{item.a_column}} </td> <td> {{item.another_column}} </td> </tr>
<tr ng:repeat="ex in item.examples"> <td> {{ex.some_key}} </td> <td> {{ex.a_column}} </td> <td> {{ex.another_column}} </td> </tr>
</remove_me>
</table>
Thoughts?
- Paul