开发者

Adding a datagrid inside another datagrid

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 formatte开发者_如何学编程r, but cant seem to get it added. How would I acheive this? Or is there a better way?


What you are looking for exists! Check it out: subgrids!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜