Thursday, March 27, 2014

Re: How to style ClickableTextCell Column that was rendered as Image Column (GWT)?

Thax you very much Jen, Actually you mentioned the key point of the question, you haven't provide a complete answer though.

So I came up with a solution for creating the ImageColumn in CellTable. I believed this is the simplest way to make ImageColumn:

That is, don't even need to Override render, just create a simple ClickableTextCell & then style background-image for the imageColumn. It will show really nicely.

     String[] msg={"12","love",""}; //just put empty String value for the column        Column<String[], String> deleteColumn=new Column<String[], String>(new ClickableTextCell()){                @Override              public String getValue(String[] object) {                  // TODO Auto-generated method stub                  return object[3];              }         };         deleteColumn.setCellStyleNames(getView().getRes().css().gwtCellImage());  

In CSS:

.gwtCellImage{      background-image:url('/images/icon/delete.png');      }    .gwtCellImage:hover{      background-image:url('/images/icon/deleteRed.png');   }     .gwtCellImage, .gwtCellImage:hover{      background-size:16px 16px;      background-position:center;      background-repeat:no-repeat;      cursor: pointer;      cursor: hand;  }  

On Friday, March 28, 2014 4:40:24 AM UTC+11, Jens wrote:
There is not a single HTML button in your example so how do you think your CSS should ever work if your CSS targets buttons?

-- J.

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment