Hi,

Can anyone help me out explaining how to add a hyperlink in a cell for any
grid?
I could set simple data into my grid but unable to find out how to add a
hyperlink in one of the columns.
Please let me know.



On Tue, Jun 30, 2009 at 8:21 AM, hezjing <hezj...@gmail.com> wrote:

> Hi Ian,
>
> You example works fine except that I have to include myGrid when setting
> the styles into the cells like the following:
>
>  f.setStyleName(0, 0, "myGrid my-Grid-ne my-Grid-border-row
> my-Grid-border-col");
> f.setStyleName(0, 1, "myGrid my-Grid-n  my-Grid-border-row");
> f.setStyleName(0, 2, "myGrid my-Grid-nw my-Grid-border-row
> my-Grid-border-col");
> f.setStyleName(1, 0, "myGrid my-Grid-e  my-Grid-border-col")
>
>
> For some reasons, the myGrid style specified in Grid has no effect in the
> cells.
>
> Thanks Ian, you shown me a good CSS example and it is very helpful for a
> Java Swing developer like me ;-)
>
>
>
> On Mon, Jun 29, 2009 at 8:06 PM, Ian Bambury <ianbamb...@gmail.com> wrote:
>
>> You can apply border-spacing to a table (e.g. your grid) which adjusts the
>> spacing between cells. To get rid of it completely, you need to set
>> border-collapse:collapse to the *table* (not the cells - i.e.not the td
>> elements)
>> I think you can get away with setting font-size on the table/grid and to
>> make the css easier, you might like to set style something like below. It
>> makes the code easier to read (e.g. every cell has ne. n, nw to indicate
>> where it is in the grid) and the css is so much simpler - you set all the
>> widths/heights in one place and therefore don't miss any if you change from
>> 5px to 3px, say.
>>
>>         Grid grid = new Grid(3, 3);
>>         grid.setStylePrimaryName("my-Grid");
>>         CellFormatter f = grid.getCellFormatter();
>>         f.setStyleName(0, 0, "my-Grid-ne my-Grid-border-row
>> my-Grid-border-col");
>>         f.setStyleName(0, 1, "my-Grid-n  my-Grid-border-row");
>>         f.setStyleName(0, 1, "my-Grid-nw my-Grid-border-row
>> my-Grid-border-col");
>>         f.setStyleName(1, 0, "my-Grid-e  my-Grid-border-col");
>>         .
>>         .
>>         .
>> and then the css is simpler
>>
>>  .my-Grid
>> {
>>     font-size               :  1px;
>>     border-collapse     :   collapse;
>> }
>> .my-Grid-border-row
>> {
>>     height                  :    5px;
>> }
>>  .my-Grid-border-col
>> {
>>     width                   :    5px;
>> }
>> .my-Grid-ne
>> {
>>     /* put the north-east corner image here */
>> }
>> etc
>>
>>  Ian
>>
>> http://examples.roughian.com
>>
>>
>>
>>
>>
>
>
> --
>
> Hez
>
> >
>


-- 
-Regards,
Sowjanya.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to