Nested Grid / row span

I want cells of one of the columns of a grid to contain a nested grid - in display mode not in edit mode. The following shows one row - basically the cell c1 should span three rows or alternatively embed a nested 2X3 grid in the second cell.

----------------------------
              | c11 | c12  |
              |------------- 
    c1        | c21 | c22  |
              |-------------
              | c23 | c24  |    
-----------------------------

I have achieved this by implementing a cell formatter for the second column (based on a suggestion found in smartclient forum) and embedding a HTML table. The issue now is I need to be able to respond to events (click etc) on the nested cells. Any pointers on how to go about achieving this?

Is there a simpler way of achieving the above without using HTML tables?

I am using the latest nightly build (12/18).

Thanks and regards,
Kamal

Hi Kamal,

It depends. Is your data model a data cube similar to the example shown here? If so, that component has editing capabilities (although it’s not yet exposed in SmartGWT - will be in SmartGWT EE).

Otherwise, your current approach is probably the easiest path, but if you could explain more about your data model (like what the cell values mean to the user), maybe there’s a better approach..

Thanks for the suggestion. I will look at the sample. My requirements are very simple. I am trying to re-implement the Calendar widget as the one provided out of the box has a few limitations.

I have to support multiple periods per hour ( up to 6 per hour) - I am trying to do this with two columns the first column will be the hours column and the second will show the periods per hour. I also want to show the hours center aligned vertically. I was trying to do this by splitting all the columns other than the first one into multiple columns. I have taken a second look and feel that it would be better to do it the other way - ie have one row per period and then figure out a way to combine the cells of the hour column into one. Support for row span would have been ideal.

The other short comings in the Calendar are the inability to add more than one appointment per period - in google calendar for example there is a small area towards the right of the cell that is not covered even if an event exists - this can be clicked to add a new event.

Another suggestion I have is that in the longer run it would be better to re-implement the complex widgets like Calendar etc in terms of the other basic controls (ListGrid, Forms etc) - it would then enable more people to contribute extensions / changes.

Thanks,
Kamal

The Calendar is implemented via other, simpler components and is open for contribution. Suggest you get a copy of SmartClient LGPL and look at the docs and source there. Your extensions are relatively straightforward as compared to the path you have been considering, and contributing them would be of help to other users.