I have a requirement where I need to create a multi level grid. Where when user clicks on checkbox a child grid will be opened. Please look at HTML shown below:
<table>
<thead>
<tr>
<th>check</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td><label class="checkbox"><input type="checkbox"><a>test</a></label></td>
<td> Description</td>
</tr>
<tr>
<td colspan="12">
<table>
<tr>
<td><label class="checkbox"><input type="checkbox"><a>testing</a></label></td>
<td>description</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
Something similar as shown here: http://dojo.telerik.com/uQEx. I have written angular code for it. And I have wrapped tr in *ngfor to show high level. Please look at code shown below:
<tr *ngFor = "let data of values">
<td>
<label class="checkbox">
<input type="checkbox">
</label>
<a (click) = "getTerms(data.id)">{{data.id}}</a>
</td>
<td>{{data.desc}}</td>
</tr>
I need to append another list when I click on a tag that is data.id
. I am confused how to append response of sub terms in html. Please let me know if you have any suggestion. Also I don't want to use any plugin for it.
EDIT:
The response I am getting on page load is:
[
{id:1, desc:'test', level: 0},
{id:2, desc:'testing',level: 0}
]
And now when I click on id =1 column I am sending service request: /get/Term/1 And I am getting response:
[ {id:5, desc: 'test test', level: 1} ]
In the similar way now if I click on id=5 I will get response as: [ {id:8, desc: 'test test test', level: 2} ]
Hope now its clear.