Search in sources :

Example 1 with LoadEvent

use of com.extjs.gxt.ui.client.data.LoadEvent 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<SiteDTO>(loader);
    if (editorGrid == null) {
        editorGrid = new EditorGrid<SiteDTO>(listStore, columnModel);
        editorGrid.setLoadMask(true);
        // editorGrid.setStateful(true);
        editorGrid.setClicksToEdit(ClicksToEdit.TWO);
        editorGrid.setStripeRows(true);
        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);
        add(editorGrid, new BorderLayoutData(Style.LayoutRegion.CENTER));
        layout();
    } else {
        editorGrid.reconfigure(listStore, columnModel);
    }
    this.currentFilter = filter;
    loader.load();
}
Also used : LoadEvent(com.extjs.gxt.ui.client.data.LoadEvent) QuickTip(com.extjs.gxt.ui.client.widget.tips.QuickTip) BorderLayoutData(com.extjs.gxt.ui.client.widget.layout.BorderLayoutData) BasePagingLoader(com.extjs.gxt.ui.client.data.BasePagingLoader) GridSelectionModel(com.extjs.gxt.ui.client.widget.grid.GridSelectionModel) LoadListener(com.extjs.gxt.ui.client.event.LoadListener) PagingLoadResult(com.extjs.gxt.ui.client.data.PagingLoadResult) SiteDTO(org.activityinfo.shared.dto.SiteDTO)

Aggregations

BasePagingLoader (com.extjs.gxt.ui.client.data.BasePagingLoader)1 LoadEvent (com.extjs.gxt.ui.client.data.LoadEvent)1 PagingLoadResult (com.extjs.gxt.ui.client.data.PagingLoadResult)1 LoadListener (com.extjs.gxt.ui.client.event.LoadListener)1 GridSelectionModel (com.extjs.gxt.ui.client.widget.grid.GridSelectionModel)1 BorderLayoutData (com.extjs.gxt.ui.client.widget.layout.BorderLayoutData)1 QuickTip (com.extjs.gxt.ui.client.widget.tips.QuickTip)1 SiteDTO (org.activityinfo.shared.dto.SiteDTO)1