[转载]Create a Basic TreeGrid – jQuery EasyUI.
The TreeGrid component extend from DataGrid but allowing a parent/child relationship between rows. Many properties extended from DataGrid can be used in TreeGrid. To use the TreeGrid, users must define the ‘treeField’ property that indicate which field to display as tree node.
This tutorial will show you how to set up the folder browser using the TreeGrid component.
Build the TreeGrid
- <table id=“test” title=“Folder Browser” class=“easyui-treegrid” style=“width:400px;height:300px”
- url=“data/treegrid_data.json”
- rownumbers=“true”
- idField=“id” treeField=“name”>
- <thead>
- <tr>
- <th field=“name” width=“160”>Name</th>
- <th field=“size” width=“60” align=“right”>Size</th>
- <th field=“date” width=“100”>Modified Date</th>
- </tr>
- </thead>
- </table>
Download the EasyUI example: