PDA

View Full Version : Live GroupSummary Grid Collapse All Groups Does not always work



nstokoe
2 Mar 2012, 12:41 PM
At one point the collapseAllGroups method of the GroupSummaryView class worked but after some code updates it no longer works. I am not sure if this is related to the Beta3 updates or whether it has always not worked in certain situations. Here is my code:



public Widget asWidget() {

colModel = new ColumnModel<Item>(this.getColList());
store = new ListStore<Item>(props.key());

HtmlTemplate.MainPageLayout templates = GWT.create(HtmlTemplate.MainPageLayout.class);
HtmlLayoutContainer htmlCon = new HtmlLayoutContainer(templates.getTemplate());
innerHtmlCon = new HtmlLayoutContainer("<div class=\"gridHolder\"></div>");

htmlCon.add(innerHtmlCon, new HtmlData(".pageContent"));

return htmlCon;
}

public void setData(ArrayList<Item> data) {

summary = new GroupSummaryView<Item>();
summary.setForceFit(true);
summary.setShowGroupedColumn(false);

// Fill the list store with the data
store.addAll(data);
// Set the sort info so that it sorts by lastIngestedTime
store.addSortInfo(new StoreSortInfo<Item>(props.lastIngestedTime(), SortDir.DESC));
store.applySort(true);

grid = new Grid<Item>(
store, colModel);
grid.setBorders(true);
grid.setView(summary);
grid.getView().setShowDirtyCells(false);
grid.setHeight(CommonConstants.GRID_HEIGHT);

StringFilter<Item> shortNameFilter = new StringFilter<Item>(props.productShortName());
DateFilter<Item> lastIngestedFilter = new DateFilter<Item>(props.lastIngestedTime());
DateFilter<Item> lastObservedFilter = new DateFilter<Item>(props.lastObsTime());

filters = new GridFilters<Item>();
filters.initPlugin(grid);
filters.setLocal(true);
filters.addFilter(shortNameFilter);
filters.addFilter(lastIngestedFilter);
filters.addFilter(lastObservedFilter);

Scheduler.get().scheduleFinally(new ScheduledCommand() {
@Override
public void execute() {
summary.groupBy(datasource);
}
});

summary.collapseAllGroups();

innerHtmlCon.add(grid, new HtmlData(".gridHolder"));

}


Anyone else see this problem?

WesleyMoy
29 Mar 2012, 3:05 PM
The code snippet you posted seems to be missing pieces. I can't find a definition of Item or getColList. Is this based on one of the existing examples?

Also, please take a moment to test against the release candidate build (http://www.sencha.com/forum/showthread.php?191578-Ext-GWT-3.0-Release-Candidate-is-now-available) and see if you still notice this issue.