Monday, March 14, 2016

Re: onBrowserEvent change Cell colour

Indeed it does help Gilerto.  I'm indebted, thank you.  You can see I "think in Java" mode (not being a 'web developer') - missed the obvious, apologies.

Although my Cell looks like
interface Template extends SafeHtmlTemplates {
@Template("<table>" +
"<tr height=4px>" +
"<td><img src=\"{0}\"/ height='20' width='20'></td>" +
"<td>{1}</td>" +
"</tr>" +
"</table>")
SafeHtml showTrack(String Image, String name);
}

...and what I wanted was the whole row to be highlighted, but right now it just highlights the background of the text area (not the whole cell browser cell)

Regards Sam

On 13 March 2016 at 23:49, Gilberto <gilberto.torrezan@gmail.com> wrote:
You just want to change the color on mouse over or need something else?

I ask that because if the problem is only about changing the color of the cell, you can do that with plain CSS.

Something like that:

Java code:
yourTable.addStyleName("myNiceTable");

CSS:

.myNiceTable td:hover {
    color: red; /* or something else */
}

Generally speaking, developers usually change the background color of the hovered table row. For that, you can use a similar CSS:

.myNiceTable tr:hover {
    background-color: #f2f2f2;
}

Hope that helps ;-)

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/Hrn-Wv7imSo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

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

No comments:

Post a Comment