You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Bryan Lewis <jb...@gmail.com> on 2012/06/13 19:37:25 UTC

Grid with split rows

I've been asked to add a number of columns to a Grid.  It'll end up with 13
columns, a few of them rather wide , so the whole thing won't fint in a
page width.  We used to handle this by doing the editing in a separate
page, but our users are asking if it's possible to do all the editing
in-place.

The only thing I can think of is to split the row, so each row of data
takes up two lines.  I'm okay with the data on the second line having no
header and not being sortable.  Has anyone tried this?

Re: Grid with split rows

Posted by Bryan Lewis <jb...@gmail.com>.
The lightbox idea is cool.  So is the AddGridRow component idea, if my
users can't stand the idea of a pop-up dialog.  I gave it a quick try and
it works well, produces valid html.  (And it hides the ugly markup from the
template, to preserve a facade of self-respect.)

Thanks, y'all.

RE: Grid with split rows

Posted by "Poder, Jacob" <ja...@thermofisher.com>.
Continuing the "pragmatic" approach but still requiring valid HTML...

// Component Java (no tml)
// Ends current row and starts a new one
@SupportsInformalParameters
public class AddGridRow {
	void beginRender(MarkupWriter writer) {
		writer.writeRaw("</td></tr><tr><td colspan=\"100\">");
	}
}

// Usage
<p:lastCell>
  Last cell's contents
  <t:addGridRow>
      <t:textarea .../>
      <t:textarea .../>
  </t:addGridRow>
</p:lastCell>

Not exactly pretty though...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid with split rows

Posted by Lance Java <la...@googlemail.com>.
I don't think that is valid HTML (tr inside tr).

I find that a lightbox can be a nice way of doing crud for a grid. When you
click on a read only row, you show a bean editor in a lightbox

http://www.opensourcehunter.com/2010/06/25/40-javascript-lightbox-scriptsincluded-jquery-and-mootools/

But chances are you are too pragmatic (lazy) to implement that ;)

Re: Grid with split rows

Posted by Bryan Lewis <jb...@gmail.com>.
Thanks.  But me being a "pragmatic" programmer (aka lazy), I solved it by
inelegantly stuffing the extra row tags into the last grid cell, like:

<p:lastCell>
  Last cell's contents
  <tr>
    <td colspan="11">
      <t:textarea .../>
      <t:textarea .../>
    </td>
  </tr>
</p:lastCell>


On Wed, Jun 13, 2012 at 4:05 PM, Lance Java <la...@googlemail.com>wrote:

> You could write a mixin which manipulates the table's DOM after the grid
> has
> rendered. For each grid row you could create an extra row and move selected
> cells into the second row.
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Grid-with-split-rows-tp5713853p5713857.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Grid with split rows

Posted by Lance Java <la...@googlemail.com>.
You could write a mixin which manipulates the table's DOM after the grid has
rendered. For each grid row you could create an extra row and move selected
cells into the second row. 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-with-split-rows-tp5713853p5713857.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org