May 09, 2021 jQuery EasyUI
In this section, you'll learn how to create a complex jQuery EasyUI tree mesh.
Tree grids can display spreadsheets with multiple columns and complex data on a limited space. The following example shows how to arrange table data in a split grid and multi-row header to organize common data.
<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>
As you can see, tree grids use the same data grids as datagrids. Use the 'frozen' property to define frozen columns, and the 'colspan' and 'rowspan' properties to define multi-row headers.