Re: Grid with <td rowspan="2">

188 views
Skip to first unread message

Manuel Carrasco Moñino

unread,
Oct 16, 2012, 2:37:49 AM10/16/12
to google-we...@googlegroups.com
you can use different ways to create a new table in gwt:

- Uibinder:
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder">
<div>
<table ui:field="mytable">
</table>
</div>
</ui:UiBinder>

@UiField
TableElement mytable;

- HTML
HTML html = new HTML("<table></table>");

- GwtQuery
$(document).append("<table></table>");


But if you want to modify an existing Grid widget with handwritten
html, you have to use gquery or specific GWT DOM
$("tbody > tr", mygrid).eq(0).after("<tr><td></td></tr>");
$("tbody > tr", mygrid).eq(0).children("td").eq(0).attr("rowspan", "2");

Be aware that changing the html code of a Grid by hand could cause
other problems like certain methods would return incorrect values
(like grid.getRowCount())


- Manolo

On Mon, Oct 15, 2012 at 10:10 PM, qinyc <qiny...@gmail.com> wrote:
> I'm maintaining code to display a g:Grid. How could I generate code like
> this: <td rowspan="2"> using either UIBinder or JSNI? (No FlexTable)
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/1sgmBcRJVYMJ.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.

Andrei

unread,
Oct 16, 2012, 4:49:57 AM10/16/12
to google-we...@googlegroups.com
Each row in a CellTable or DataGrid represents an object. If you create a cell with rowspan=2, it would break all the logic. At this point you will have to build your own custom table from scratch, including your own DataProvider, SelectionModel, SortHandler, etc.

Why do you need it? I am trying to imagine a use case, but it's a very rare design approach - for a reason.
Reply all
Reply to author
Forward
0 new messages