Friday, September 30, 2011

Re: Add style for even row and add row in cellTable.

There are three ways to add style to celltable
1. Global css
2. Inline Style sheet using UiBinder
3. Using CellTable.Resources

Extend the CellTable.Resources interface and specify the
CellTableStyle.css in source attribute. I send the code segment of
CellTable.Resources used in CellTable.

// In .java file use the below code. CellTableStyle.css file in your
project directory.

interface TableResources extends CellTable.Resources
{
@Source(value = { CellTable.Style.DEFAULT_CSS,
"CellTableStyle.css" })
CellTable.Style cellTableStyle();
}

//add CellTableStyle.css in cellTable

CellTable<Your_domain_class> result = new CellTable(15,
GWT.<TableResources> create(TableResources.class));

//CellTableStyle.css

.cellTableCell
{
height: 20px;
padding: 2px 25px;
}

.cellTableHeader
{
height: 20px;
border-bottom: 2px solid #60a6bf;
}

.cellTableEvenRow
{
background: #fffaf0;
border:solid 1px red;
}

.cellTableEvenRowCell
{
border:solid 1px green;
}

.cellTableOddRow
{
background: #fff8e8;
}

.cellTableOddRowCell
{
border:solid 1px red;
}

S. Abraham
www.DataStoreGwt.com
Persist objects directly in GAE

--
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-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment