If you have ever used the DataGrid before, you may have found yourself frustrated with DataGridColumn and the fact that dataField does not support nested properties (like dataField=”object.property” or dataField=”objectList[2].property).

This is normally not a huge deal because you can either make your own labelFunction and sortFunction to deal with this, or you can just make a custom itemRenderer to display the data you want.  However, this take time which makes it not the best solution in general.

There are other people who have solved this problem, but they do it by extending DataGridColumn.  In my custom NestedDataGrid I do everything by extending DataGrid without messing with DataGridColumn.  I prefer this approach because it is more intuitive for me, and I mean seriously, NestedDataGridColumn is just too long! :) 

Another reason to use NestedDataGrid is that I also add support for using brackets instead of just the dot syntax, which allows you to access properties inside of an Array or ArrayCollection, or using properties on an object at runtime (i.e. object[property]).  You can also do as many nested levels as you want (i.e. dataField=”object.object1.object2.arrayCollection[0].property1…).  It also works great for XML-based data providers as of my latest update.

See the demo and get the source here (Right click to View Source).

Also, feel free to combine NestedDataGrid with my ScalableDataGrid custom component.  Just download both components and then make NestedDataGrid extend ScalableDataGrid or vice versa!