質問

I'm using SmartGWT 2.5.

I have a main grid that has its expandable rows in order to display subgrids. I simply want to display the main grid with all its rows expanded from the start.

I tried to add a listener containing the following code:

ListGridRecord[] records = getRecords();
for (ListGridRecord rec : records) {
    expandRecord(rec);
}

I tried with DataArrivedHandler and DrawAreaChangedHandler, but I just get javascript errors client-side or only parts of the rows are expanded. How can I fix this?

役に立ちましたか?

解決 3

Ok finally, I've put a timer of 100 ms within each handler. The issue was that there was a delay before the full creation of the components (what I want to display is quite complex), and so when the handler was called, not everything was in place yet...

他のヒント

If you are talking about Grid Grouping, then you can use the following:

grid.setGroupStartOpen(GroupStartOpen.ALL);
listGrid.addDataArrivedHandler(new DataArrivedHandler() {
        @Override
        public void onDataArrived(DataArrivedEvent event) {
            for (ListGridRecord rec : listGrid.getRecords()) {
                listGrid.expandRecord(rec);
            }
        }
    });

Should work (worked with previous versions..) What error do you get?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top