樹形網(wǎng)格(TreeGrid)組件從數(shù)據(jù)網(wǎng)格(DataGrid)繼承,但是允許在行之間存在父/子節(jié)點關系。許多屬性繼承至數(shù)據(jù)網(wǎng)格(DataGrid),可以用在樹形網(wǎng)格(TreeGrid)中。為了使用樹形網(wǎng)格(TreeGrid),用戶必須定義 'treeField' 屬性,指明哪個字段作為樹節(jié)點。
本教程將向您展示如何使用樹形網(wǎng)格(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>