use of com.extjs.gxt.ui.client.widget.tips.QuickTip in project activityinfo by bedatadriven.
the class FlatSiteGridPanel method initGrid.
public void initGrid(Filter filter, ColumnModel columnModel) {
PagingLoader<PagingLoadResult<SiteDTO>> loader = new BasePagingLoader<PagingLoadResult<SiteDTO>>(new SiteProxy());
loader.addLoadListener(new LoadListener() {
@Override
public void loaderLoadException(LoadEvent le) {
Log.debug("Exception thrown during load of FlatSiteGrid: ", le.exception);
}
});
loader.setRemoteSort(true);
loader.setSortField("date2");
loader.setSortDir(SortDir.DESC);
pagingToolBar.bind(loader);
listStore = new ListStore<>(loader);
if (editorGrid == null) {
editorGrid = new EditorGrid<SiteDTO>(listStore, columnModel);
editorGrid.setLoadMask(true);
// editorGrid.setStateful(true);
editorGrid.setClicksToEdit(ClicksToEdit.TWO);
editorGrid.setStripeRows(true);
final GridSelectionModel<SiteDTO> sm = new GridSelectionModel<SiteDTO>();
sm.setSelectionMode(SelectionMode.SINGLE);
sm.addSelectionChangedListener(new SelectionChangedListener<SiteDTO>() {
@Override
public void selectionChanged(SelectionChangedEvent<SiteDTO> se) {
fireEvent(Events.SelectionChange, se);
}
});
editorGrid.setSelectionModel(sm);
new QuickTip(editorGrid);
editorGrid.addListener(Events.RowDoubleClick, new Listener<GridEvent>() {
@Override
public void handleEvent(GridEvent be) {
SiteDTO site = listStore.getAt(be.getRowIndex());
SelectionChangedEvent<SiteDTO> event = new SelectionChangedEvent<>(sm, site);
fireEvent(Events.RowDoubleClick, event);
}
});
add(editorGrid, new BorderLayoutData(Style.LayoutRegion.CENTER));
layout();
} else {
editorGrid.reconfigure(listStore, columnModel);
}
this.currentFilter = filter;
loader.load();
new QuickTip(editorGrid);
}
Aggregations