GWT CELLTABLE : How to set descending icon to column on celltable header ?

612 views
Skip to first unread message

vaibhav bhalke

unread,
Oct 4, 2011, 5:51:53 AM10/4/11
to google-we...@googlegroups.com
Hi all,

How to set column in descending i.e DESC icon on top header  ?

On celltable loading.. I want to set sorting order to column i.e. previously sorted column/sorting order by user (In last login , before logout)

I tried following way
table.getColumnSortList().push(testColumn); i.e setting column ascending to true with ASC Icon on top of header.

Some times I want to set column in descending i.e DESC icon on top header ? How to do it ?

--
Best Regards,
Vaibhav






Sudhakar Abraham

unread,
Oct 4, 2011, 7:03:39 AM10/4/11
to Google Web Toolkit
Edit cellTableHeader property in cellTableStyle.css file. Implement
the CellTable.Resources interface. Add your header icon at background-
image("your_background_icon") tag in CellTableStyle.css file.

//client side code.

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

//Add your CellTableStyle.css in your cellTable

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


//CellTableStyle.css

.cellTableHeader
{
height: 20px;
border-bottom: 2px solid #60a6bf;
padding: 3px 25px;
text-align: left;
color: blue;
text-shadow: #ddf 1px 1px 0;
overflow: hidden;
cursor:pointer;
background-image: url(your_icon.gif);
background-repeat:no-repeat;
background-position:80% 50%;
}

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

vaibhav gwt

unread,
Oct 5, 2011, 5:12:18 AM10/5/11
to Google Web Toolkit
Thanks for replay
My problem is that I want to show sorted order of column after
celltable loading. eg. I have xml. I am getting only one column
information i.e column(columnname, sortedOrder[false/true],dataTypeOf)
as per column information I want to set ASC/DESC icon close to Column
as per sorted value

On Oct 4, 4:03 pm, Sudhakar Abraham <s.abra...@datastoregwt.com>
wrote:

Claude

unread,
Oct 5, 2011, 5:19:18 AM10/5/11
to google-we...@googlegroups.com
Just call you method twice and the icon will be DESC :)

table.getColumnSortList().push(testColumn); => ASC
table.getColumnSortList().push(testColumn); => DESC

Reply all
Reply to author
Forward
0 new messages