Musicman75 | 24 Jan 15:49 2011

Highlight some rows in CellTable

Hello,

I need to highlight some rows in a cellTable, used with 2 dirrerent
colors like the original coloring.

e.g:
row1 - white
row2 - blue
row3 - white
row4 - blue
row5 - light yellow
row6 - dark yellow
row7 - light yellow
row8 - dark yellow
row9 - white
row10 - blue
row11 - white
row12 - blue

First step was to copy/paste the original GWT table and change the
renderRowValues(...) function.
In FF and Chrome everything works ok, but in IE8 the table isn't
shows.

I can't debug in IE because of the bug in the Development plugin for
IE.

I need some help highlightening the rows in the original CellTable
without copy/paste the code.

(Continue reading)

Tolwi | 24 Jan 16:46 2011
Picon

Re: Highlight some rows in CellTable

cellTable.setRowStyles(..)

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Musicman75 | 25 Jan 09:12 2011

Re: Highlight some rows in CellTable

I tried that, but I have to add more styles than the default.

I need two more styles

oddRowHighlighted
evenRowHighlighted

Or explicit set a row style to a defined row.

On 24 Jan., 16:46, Tolwi <alexander....@...> wrote:
> cellTable.setRowStyles(..)

--

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

Musicman75 | 25 Jan 13:04 2011

Re: Highlight some rows in CellTable

Ok, it works now.

First I override the default style by extending the
CellTable.Resources and CellTable.Style:

public interface CellTableResource extends CellTable.Resources {

    /**
     * The Interface CellTableStyle.
     */
    public interface CellTableStyle extends CellTable.Style {
    };

    /*
     * (non-Javadoc)
     *
     *  <at> see
com.google.gwt.user.cellview.client.CellTable.Resources#cellTableStyle()
     */
     <at> Override
     <at> Source({ "SourceViewTable.css" })
    CellTableStyle cellTableStyle();
};

Then I added the style with the defalt names, but without background
color setting.
If you set a background color in the style, you can't override it with
another style.

After that I used the setRowStyles function on the celltable, to set
the necessary background color:

codeTable.setRowStyles(new RowStyles<CodeViewerDto>() {

             <at> Override
            public String getStyleNames(CodeViewerDto row, int
rowIndex) {
                if (row.isHighlighted()) {
                    if (rowIndex % 2 == 0) {
                        return "cellTableEvenRowHighlight";
                    } else {
                        return "cellTableOddRowHighlight";
                    }
                } else {
                    if (rowIndex % 2 == 0) {
                        return "cellTableEvenRowBg";
                    } else {
                        return "cellTableOddRowBg";
                    }
                }
            }
        });

--

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


Gmane