In the last post I showed how to create a categorized Dojo TreeGrid. In this post, we’ll take a look at a few extra features available to the grid.
The code from the last post serves as the baseline and this post will highlight any changes that are required.
defaultOpen
The defaultOpen property can be added to define whether the grid should be expanded when rendered.
var grid = new dojox.grid.TreeGrid({ treeModel: treeModel, structure: layout, defaultOpen: true }, 'treeGrid');
expandoCell
The expandoCell property defines which cell should include the expand/collapse icon. It’s a 0-based index, so to put the icon in the second column, give it a value of 1.
var grid = new dojox.grid.TreeGrid({ treeModel: treeModel, structure: layout, expandoCell: 1 }, 'treeGrid');
Up Next
In the next post, I’ll show how to add counts and totals to the TreeGrid.
