Reputation: 47387
I have a datagrid that uses a data structure like:
[
{
name: "test"
sub_things: [ { name: "blah" }]
}
]
Each row will have varying numbers of sub things and I an trying to add them as subrows in a row in the datagrid by adding another datagrid in the cell formatter, but cant seem to get it added. How would I acheive this? Or is there a better way?
Upvotes: 2
Views: 1377
Reputation: 9635
Putting datagrids in datagrids, even if you can figure out how to do it sounds like a recipe for slowing down the browser or making it explode.
You could consider a few things:
Make this into a two step process. The first datagrid just has the name "test" and maybe a brief summary of sub_things. When you click on a row, it opens a new grid on another tab or maybe on the right side which contains the sub things just for that item.
You could use multi row layout of the datagrid like explained on this page (scroll down a bit for the multirow examples) http://www.sitepen.com/blog/2008/07/14/dojo-12-grid/
You could have a combox box with a type ahead suggest of the main items and when one item is selected, then render a datagrid below it with the sub items.
By nesting grids in grids you are going to create a usability nightmare, so I would really recommend focusing on how to limit the data shown to the user and keep it as simple as possible.
Upvotes: 0