I wanted something similar (to align the sort icon next to the text, on the 
right hand side).  Here's how I did it.

1. Removed the default icons.  See: 
http://stackoverflow.com/questions/9638940/gwt-celltable-remove-the-sorting-arrow-from-a-header
2. Created my own Header class.  Ie: public class MyHeader extends 
Header<String>
2.1 Passed the table into the headers constructor, so it could listen for 
the column sort.  Ie: table.addColumnSortHandler.
2.2 In the header, override the render method to render your text, and your 
icon (you know which icon to use, ascending or descending, from the column 
sort events).

Note:  When you do your rendering, you'll need to offset it to the left by 
6 pixels.  This is because, even though you removed the default arrows, 
there is still a 6 pixel gap put in by GWT.  Ie: left:-6px;position:relative

It's quite a bit of work for something that should be fairly easy to do. 
 If anyone has an easier way, I'm all ears.


On Tuesday, 19 February 2013 21:20:44 UTC+11, membersound wrote:
>
> Hm to my that seems to be a bit overkill for just changing the icon place.
> And what is more - looking at the showcase from 
> http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwCustomDataGrid-
>  the icon will be aligned at most right position of the cell.
>
> But that's not what I want. I'd like to have it aligned right but directly 
> beneath the header text.
>
> Am Dienstag, 19. Februar 2013 09:04:40 UTC+1 schrieb Alex opn:
>>
>> Have a look at the 
>> CwCustomDataGrid<http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCustomDataGrid.java?r=10597>from
>>  the showcase. You'll have to create a custom header builder 
>> extendingAbstractHeaderOrFooterBuilder. 
>> AbstractHeaderOrFooterBuilder offers a method "
>>
>> setSortIconStartOfLine(boolean)"
>>
>>

-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to