0
添加列进行排序的功能,我有一个的TreeGrid是建立这样的:上的TreeGrid HTML
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Number</th>
</tr>
</thead>
<tbody>
<tr class="treegrid-0">
<th>name2</th>
<th>type2</th>
<th>Number2</th>
</tr>
<tr class="treegrid-1">
<th>name1</th>
<th>type1</th>
<th>Number1</th>
</tr>
<tr class="treegrid-2 treegrid-parent-1" style="display:none;">
<th>name1-A</th>
<th>type1-A</th>
<th>Number1-A</th>
</tr>
<tr class="treegrid-3 treegrid-parent-1" style="display:none;">
<th>name1-B</th>
<th>type1-B</th>
<th>Number1-B</th>
</tr>
<tr class="treegrid-4">
<th>name0</th>
<th>type0</th>
<th>Number0</th>
</tr>
</tbody>
</table>
我想补充的排序选项时,我在一列点击。 排序选项只能在顶级父级上完成。 这是一个treegrid,所以预期的行为是如果父节点必须移动,那么子节点也必须与父节点一起移动。
我该如何做到这一点与JS?
感谢您的建议,我已经知道Datatable,但对于我的项目,必须使用可以通过分层视图显示数据的可检索视图。 – wawanopoulos