Thursday, March 27, 2014

How to insert Image into Column Header of CellTable (GWT)?

If we use Text for the header then it may take some space, so I want the Header have an icon(like Delete Icon) so I can save some space for the Header.

So I tried

myCellTable.addColumn(deleteColumn,new SafeHtmlHeader(SafeHtmlUtils.fromSafeConstant  ("<img width=\"30px\" height=\"30px\" src=\"image/icon/delete.png\">")));

It showed the image but the Image is very small about (10px - 10px) and it has a ugly border around the image.


Someone said using CUstom Header, but I couldn't override getHeaderStyleNames(). Ex:

class DeleteHeader extends Header{      @Override      public String getHeaderStyleNames(){          return "css style";      }  }  

It said i have to override supertype something....!!

So how to fix it?

--
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