jQuery TreeGrid使い方

1.プラグインを初期化
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.treegrid.js"></script>
<link rel="stylesheet" href="css/jquery.treegrid.css">

<script type="text/javascript">
$('.tree’).treegrid();
</script>

2.テーブルを作成
<table class="tree">
<tr class="treegrid-1″>
<td>Root node</td><td>Additional info</td>
</tr>
<tr class="treegrid-2 treegrid-parent-1″>
<td>Node 1-1</td><td>Additional info</td>
</tr>
<tr class="treegrid-3 treegrid-parent-1″>
<td>Node 1-2</td><td>Additional info</td>
</tr>
<tr class="treegrid-4 treegrid-parent-3″>
<td>Node 1-2-1</td><td>Additional info</td>
</tr>
</table>

Source

Posted by arkgame