bradr <brad.rydzew...@...> writes:

> 
> To do this, you have to override the CellTable's default style.
> Because CellTable uses a CssResource, which ultimately gets obfuscated
> when you compile, you have to create your own implementation and pass
> it to the CellTable in the constructor.
> 
> Here is how I did it:
> 
> Step 1) Create your own implementation of the Resource
> 
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.user.cellview.client.CellTable;
> import com.google.gwt.user.cellview.client.CellTable.Resources;
> public interface MyCellTableResources extends Resources {
> 
>       public MyCellTableResources INSTANCE =
>               GWT.create(MyCellTableResources.class);
> 
>       /**
>        * The styles used in this widget.
>        */
>       @Source("CellTable.css")
>       CellTable.Style cellTableStyle();
> }
> 
> Step 2) Copy the CellTable.css file into your project (from gwt trunk)
> into the same package as your Resource implementation. Customize the
> css until it meets your style needs.
> 
> Step 3) When you create an instance of the CellTable, give it your
> your custom CssResource:
> 
>    myTable = new
> CellTable<Resource>(Integer.MAX_VALUE,CellTableResources.INSTANCE);
> 
> Hope that helps!
> 
> On Oct 29, 11:55 am, bond <daniele.re...@...> wrote:
> > Hi,
> > is possibile to remove the box around the single cell that appears
> > when I click on a cell?
> >
> > Thanks very much
> >
> > Best regards
> 

Working example, based on bradr note:

1. Create new interface:
--------------------------
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.cellview.client.CellTable;

public interface CellTableResource extends Resources {

        public CellTable.Resources INSTANCE =
                GWT.create(CellTableResource.class);

        /**
         * The styles used in this widget.
         */
        @Source("style/CellTable.css")
        CellTable.Style cellTableStyle();
}

2. Copy CellTable.css 
------------------------
from: http://code.google.com/p/google-web-
toolkit/source/browse/branches/2.1/bikeshed/src/com/google/gwt/bikeshed/list/cli
ent/CellTable.css?r=8062
into the same directory (or subdirectory of CellTableResource).

3. Create your CellTable with the resource file:
----------------------------------------------------
CellTable<Contact> table = new CellTable<Contact>(20, 
CellTableResource.INSTANCE);



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to