On Wednesday, June 18, 2014 11:51:20 AM UTC+2, Christian Plätzinger wrote:
>
> Hi all,
>
> I'm trying to make some of my GWT CellTables to be responsive using CSS. 
> To be more precise I'm trying to implement the "No More Table" example 
> found at http://elvery.net/demo/responsive-tables/. Works well except the 
> fact that I have to set the data-title attribute in the HTML <td> element 
> of my cells. Does anybody has an idea how to do that?
>

First, I think you could modify the CSS to read the attribute from a <div> 
element within the <td>; you could then override the render() method of 
your Columns to wrap the cell into such a <div data-title="{columnTitle}">.

Otherwise, and to directly answer your question, you can provide your own 
CellTableBuilder 
<http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/cellview/client/CellTableBuilder.html>.
 
You could extend DefaultCellTableBuilder and override renderCell to add the 
data-title attribute to the ElementBuilderBase passed as the first 
argument; but that element is actually a <div>, so you'd have to adapt the 
CSS too. Or you could copy/paste DefaultCellTableBuilder and then modify 
buildRowImpl to add the attribute right onto the <td>; you'd have to find a 
way to retrieve the column title though (from the Column, or from a 
List<String> passed to the CellTableBuilder).

Maybe we should add an addCellAttributes, similar to the existing 
addRowAttributes, to make this kind of customization easier… Feel free to 
file a request for enhancement on the issue tracker, and/or even better, 
provide the patch (should be relatively easy to implement I suppose)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to