2
votes

I have a DataGrid in a simple layout panel that is collapsible. It is collapsed by default, and when I expand it after the page loads, the column headers are visible but the data rows are not. If I set the panel to be expanded by default, then all the data in the table is visible, and remains so after collapsing/expanding again.

Any ideas what could be causing this? I have layout panels all the way up. I tried making the panel visible to begin with, then setting it invisible in a deferred command after setting the data provider. However, at the time the deferred command ran, the table reported having two data rows but they hadn't displayed yet. The panel was set invisible before the data rows ever became visible, so they never became visible.

I hope my description makes sense. Thanks for any advice you can give!

1
Are you using a DataGrid. if yes you must put it into a LayoutPanel or Panel that implements the ProvidesResize interface. Alterantively if you use a "normal" Panel you must specify the dimensions of that panel explicitly.Ümit
Thanks, user905374! That was the problem; I had to redraw the table when I expanded it.cmdkennedy
how do you redraw the table, exactly? Can you post an answer?Stealth Rabbi

1 Answers

0
votes

Calling dataGrid.onResize() after making the grid visible did the trick for me.

Please keep in mind that onResize() may need to be called from a deffered command, like this:

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
    @Override
    public void execute() {
        view.titleGrid.onResize();
    }
});