Easy Tutorial
❮ Plugins Window Messager Jeasyui App Rssreader ❯

jQuery EasyUI Tree Menu - Create Complex TreeGrid

The TreeGrid can display a multi-column and complex data spreadsheet in a limited space. This tutorial will demonstrate how to arrange table data in a split grid and multi-row headers to organize common data.

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">2nd qrt.</th>
                <th field="f3" width="50" align="right">3rd qrt.</th>
                <th field="f4" width="50" align="right">4th qrt.</th>
                <th field="f5" width="50" align="right">1st qrt.</th>
                <th field="f6" width="50" align="right">2nd qrt.</th>
                <th field="f7" width="50" align="right">3rd qrt.</th>
                <th field="f8" width="50" align="right">4th qrt.</th>
            </tr>
        </thead>
    </table>

As you can see, the usage of TreeGrid is the same as DataGrid. Use the 'frozen' attribute to define frozen columns, and the 'colspan' and 'rowspan' attributes to define multi-row headers.

Download jQuery EasyUI Example

jeasyui-tree-treegrid2.zip

❮ Plugins Window Messager Jeasyui App Rssreader ❯