protected void bindColumnModel(ColumnModel columnModel) { if (this.columnModel != null) { this.columnModel.removeListener(Events.HiddenChange, columnModelListener); } if (columnModel != null) { columnModel.addListener(Events.HiddenChange, columnModelListener); } this.columnModel = columnModel; }
/** * Initializes the data. * * @param ds the data store * @param cm the column model */ @SuppressWarnings({"unchecked", "rawtypes"}) protected void initData(ListStore ds, ColumnModel cm) { if (this.ds != null) { this.ds.removeStoreListener(listener); } if (ds != null) { ds.addStoreListener(listener); } this.ds = ds; if (this.cm != null) { this.cm.removeListener(Events.HiddenChange, columnListener); this.cm.removeListener(Events.HeaderChange, columnListener); this.cm.removeListener(Events.WidthChange, columnListener); this.cm.removeListener(Events.ColumnMove, columnListener); } if (cm != null) { cm.addListener(Events.HiddenChange, columnListener); cm.addListener(Events.HeaderChange, columnListener); cm.addListener(Events.WidthChange, columnListener); cm.addListener(Events.ColumnMove, columnListener); } this.cm = cm; }
grid.addListener(Events.Reconfigure, listener); grid.getColumnModel().addListener(Events.HiddenChange, new Listener<ColumnModelEvent>() { public void handleEvent(ColumnModelEvent be) { verifyLayout(false); grid.getColumnModel().addListener(Events.ColumnMove, new Listener<ColumnModelEvent>() { public void handleEvent(ColumnModelEvent be) { if (initialized) {
@SuppressWarnings("unchecked") public void bindGrid(Grid grid) { if (this.grid != null) { this.grid.removeListener(Events.RowMouseDown, this); this.grid.removeListener(Events.RowClick, this); this.grid.removeListener(Events.ContextMenu, this); this.grid.removeListener(Events.ViewReady, this); this.grid.getView().removeListener(Events.RowUpdated, this); this.grid.getView().removeListener(Events.Refresh, this); this.grid.getColumnModel().removeListener(Events.HiddenChange, this); keyNav.bind(null); bind(null); } this.grid = grid; if (grid != null) { grid.addListener(Events.RowMouseDown, this); grid.addListener(Events.RowClick, this); grid.addListener(Events.ContextMenu, this); grid.addListener(Events.ViewReady, this); grid.getView().addListener(Events.RowUpdated, this); grid.getView().addListener(Events.Refresh, this); grid.getColumnModel().addListener(Events.HiddenChange, this); keyNav.bind(grid); bind(grid.getStore()); grouped = grid.getView() instanceof GroupingView; if (grouped) groupingView = (GroupingView) grid.getView(); } }