PDA

View Full Version : Nested Grid Columns



dlibby00
23 Jan 2007, 2:00 PM
I have a requirement at work that will require a grid with nested columns, similar to <td colspan="2"> in a normal table as shown below (forgive the pathetic ascii art):


**********************************
* Column *
**********************************
* Nested * Nested *
**********************************
* Nested * Nested *
**********************************
* Nested * Nested *
**********************************


A couple of questions: Is this even possible with thick Table implementations like JTable? More importantly is it possible with the yui-ext grid? Finally if it is not possible, but feasible with a bit of work I could use some prodding in the right direction. I've been doing OO javascript for a few years so I'm sure I could pull it off...

If the control does not support this and it would be very difficult to add, does nesting grids within grids make sense or is that just a path I don't want to go down.

Hope the question makes sense, and thanks in advance!

Derek

tookoo
29 Jan 2007, 9:15 AM
I second that. That would be great if the grid can support colspan. For work purpose, I need something like:
******************************************
* Table Title *
******************************************
*col name 1 *col name 2 * col name 3 *..... *
******************************************
* c1 data *c2 data * c3 data *..... *
******************************************
* c1 data *c2 data * c3 data *.... *
******************************************
.....

dlibby00
29 Jan 2007, 9:33 AM
Finally a reply!

I've done a little more digging and haven't really found an example of a grid control that can do this, though my search is far from exhaustive. The only thing I did find was a grid which supported multiple possibly nested headers:

http://www.scbr.com/docs/products/dhtmlxGrid/index.shtml

Hope I don't get booted for posting that link. :wink:

I really like what I have seen of yui-ext and I think yui itself will emerge as the toolkit of choice in the next year, so I really would like to make use of this control. It has so many great features already built in, it would be a shame to have to roll that from scratch. I suspect one issue with a grid that supports colspans is that the data model class would need some modifications.

I have yet to try nesting grid controls in grid controls but I suspect this would be a messy solution and would not scale well at tall.

Hopefully a little noise on this thread will generate a response from someone with a bit more knowledge on the subject.

TommyMaintz
29 Jan 2007, 9:42 AM
Rowspan/colspan is currently not supported by the grid, and as far as i know it wont be supported in the Grid 2.0. Also as far as i know there arent any grids out there that do support it.

The reason behind this is the huge amount of code it takes to rewrite the datamodels to support it i guess.

dlibby00
29 Jan 2007, 9:53 AM
That's what I was afraid of.

It's starting to look as though I may need to roll my own solution here. I don't really need any of the advanced features of the grid such as sorting or drag and drop. I think what I really need is sort of a souped up table that would support things like dynamic sizing of rows/colums and inline editing. Anybody aware of such a beast based on yui or yui-ext?