Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RibbonBar and rowSpan

    Hi There,

    In Smart GWT, I'm attempting to implement a RibbonBar, and can't work out how to span controls over multiple rows. The documentation states:
    The RibbonBar controls the overall presence, placement and text-alignment of each group's title and these can be overridden for individual groups.
    Groups can have multiple rows of controls (group.numRows) and additional columns of rows are automatically added when that number is exceeded.
    Controls can also span multiple rows (control.rowSpan).
    That last line says the controls can also span multiple rows. I've tried setting an attribute called "rowSpan" within the control, but that doesn't have any affect.

    For the following showcase-based example, how do I make "New" and "Open" span two rows, so that "Save" and "Save As" line up neatly next to them in a single column.
    Code:
            RibbonGroup fileGroup = new RibbonGroup();
            fileGroup.setTitle("File");
            fileGroup.setTitleAlign(Alignment.LEFT);
            fileGroup.setNumRows([b]2[/b]);
            fileGroup.setRowHeight(76);
            fileGroup.addControl(getIconMenuButton("New", "piece_blue", menu, true));      //Vertical Button. Span two rows.
            fileGroup.addControl(getIconButton("Open", "star_yellow", true));              //Vertical Button. Span two rows.
            fileGroup.addControl(getIconButton("Save", "pawn_red", [b]false[/b]));                //Horizontal Button. Span one row.
            fileGroup.addControl(getIconMenuButton("Save As", "cube_green", menu, [b]false[/b])); //Horizontal Button. Span one row.
    Many Thanks,
    Nick
    Last edited by nwilton; 14 May 2012, 14:51.

    #2
    I worked it out.

    The rowSpan comment in the documentation is incorrect. The root cause of my problem stemmed from an issue the RibbonBar sample which I was using.
    This is subsequently been fixed in http://code.google.com/p/smartgwt/source/detail?r=1964

    Basically, rowHeight governs the height of horizontal controls.

    It seems so simple now. :-)

    Comment

    Working...
    X