jQuery EasyUI ツリーメニュー -複雑なツリーグリッドの作成
ツリーグリッド(TreeGrid)は、限られたスペースで複数の列と複雑なデータを持つスプレッドシートを表示できます。このチュートリアルでは、共通のデータを整理するために、テーブルデータを分割されたグリッドと複数行のヘッダーに配置する方法を説明します。
ツリーグリッド(TreeGrid)の作成
<table title="Complex TreeGrid" class="easyui-treegrid" style="width:550px;height:250px" url="data/treegrid2_data.json" rownumbers="true" showFooter="true" idField="id" treeField="region"> <thead frozen="true"> <tr> <th field="region" width="150">Region</th> </tr> </thead> <thead> <tr> <th colspan="4">2009</th> <th colspan="4">2010</th> </tr> <tr> <th field="f1" width="50" align="right">1st qrt.</th> <th field="f2" width="50" align="right">2st qrt.</th> <th field="f3" width="50" align="right">3st qrt.</th> <th field="f4" width="50" align="right">4st qrt.</th> <th field="f5" width="50" align="right">1st qrt.</th> <th field="f6" width="50" align="right">2st qrt.</th> <th field="f7" width="50" align="right">3st qrt.</th> <th field="f8" width="50" align="right">4st qrt.</th> </tr> </thead> </table>
ご覧のとおり、ツリーグリッド(Treegrid)の使用法はデータグリッド(Datagrid)と同じです。'frozen' 属性を使用して凍結列を定義し、列の 'colspan' 属性と 'rowspan' 属性を使用して複数行のヘッダーを定義してください。
jQuery EasyUI のサンプルをダウンロード
jeasyui-tree-treegrid2.zip
その他の拡張機能