jEasyUI creates complex tree grids


TreeGrid can display spreadsheets with multiple columns and complex data on limited space. This tutorial demonstrates how to arrange tabular data in a split grid and multi-row headers to organize common data.

112.png

Create 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>

As you can see, the use of Treegrid is the same as Datagrid. Please use the 'frozen' attribute to define frozen columns, and the 'colspan' and 'rowspan' attributes of columns to define multi-row headers.

Download jQuery EasyUI instance

jeasyui-tree-treegrid2.zip