문제

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