Hello Thomas!

Thank you very much for your reply.

This is a ColumnVisibilityChangeEventHandler. It is called once I
select/deselect the column in a panel.
Hiding the data cells works flawlessly as calling "setCellStyleNames"
with the CSS class containing "display: none" works exactly as it's
meant to.
Hiding the column cells (header) however just does not work. I've
added the method-code below. I know the code is executed, because
event.getColumn().setCellStyleNames... works just as it's supposed to.

        // Begin of ColumnVisibilityChangeEventHandler-methods
        @Override
        public void onColumnVisibilityChanged(final
ColumnVisibilityChangeEvent event) {
                if (event.getColumn() != null) {
                        String style = "hiddenCell";
                        if (event.getColumn().isVisible()) {
                                event.getColumn().setCellStyleNames("");
        
cellTable.removeColumnStyleName(cellTable.getColumnIndex((Column<ItemOnCharacterDTO,?
>)event.getColumn()), ((BelongingsCellTableStyle)
cellTableResources.cellTableStyle()).cellTableHeaderHidden());
                        } else {
                                event.getColumn().setCellStyleNames(style);
        
cellTable.addColumnStyleName(cellTable.getColumnIndex((Column<ItemOnCharacterDTO,?
>)event.getColumn()), ((BelongingsCellTableStyle)
cellTableResources.cellTableStyle()).cellTableHeaderHidden());
                        }
                        cellTable.redrawHeaders();
                        cellTable.redraw();
                }
        }
        // End of ColumnVisibilityChangeEventHandler-methods

Deleting the columns does work. However: this also means, that I
cannot show the data they should contain, once I decide to readd them.
Therefore it'd be really awesome if there was a way to make it
understand the styles..
I've used the following to apply custom styles:

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

        interface BelongingsCellTableStyle extends CellTable.Style {
                 public abstract String cellTableHeaderHidden();
        }

Additionally I've included a BelongingsCellTableStyle.css in the same
package as this page. I could confirm that it sees and uses this
file..
According to Firebug the "cellTableHeaderHidden" never gets applied
(nor does "display: none" ever get applied to the header elements).
Maybe I'm doing something wrong? If you happen to have another hint,
I'd gladly try it - removing the columns is not an option though,
because the data is lost then.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to