use of com.extjs.gxt.ui.client.event.GridEvent in project activityinfo by bedatadriven.
the class PivotGridPanel method show.
@Override
public void show(final PivotReportElement element) {
if (isRendered()) {
el().unmask();
}
if (grid != null) {
removeAll();
}
PivotTableData data = element.getContent().getData();
propertyMap = new HashMap<>();
columnMap = new HashMap<>();
columnModel = createColumnModel(data);
store = new ListStore<>();
addRows(data.getRootRow(), 0);
grid = new Grid<>(store, columnModel);
grid.setAutoExpandColumn("header");
grid.setAutoExpandMin(150);
grid.setView(new PivotGridView());
grid.setSelectionModel(new CellSelectionModel<PivotGridPanel.PivotTableRow>());
grid.addListener(Events.CellDoubleClick, new Listener<GridEvent<PivotTableRow>>() {
@Override
public void handleEvent(GridEvent<PivotTableRow> ge) {
if (ge.getColIndex() != 0) {
PivotTableData.Axis row = ge.getModel().getRowAxis();
PivotTableData.Axis column = columnMap.get(ge.getColIndex());
if (row.getCell(column) != null) {
drillDownEditor.drillDown(element, row, column);
}
}
}
});
add(grid);
layout();
}
use of com.extjs.gxt.ui.client.event.GridEvent in project activityinfo by bedatadriven.
the class PiechartLayerOptions method setupIndicatorOptionsGrid.
private void setupIndicatorOptionsGrid() {
List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
columnConfigs.add(new EditColorColumn());
columnConfigs.add(new ReadTextColumn("name", I18N.CONSTANTS.indicators(), 50));
ColumnModel columnmodelIndicators = new ColumnModel(columnConfigs);
EditorGrid<NamedSlice> indicatorOptionGrid = new EditorGrid<NamedSlice>(indicatorsStore, columnmodelIndicators);
indicatorOptionGrid.setBorders(false);
indicatorOptionGrid.setAutoExpandColumn("name");
indicatorOptionGrid.setAutoWidth(true);
indicatorOptionGrid.setHeight(100);
indicatorOptionGrid.getView().setShowDirtyCells(false);
indicatorOptionGrid.setSelectionModel(new CellSelectionModel<PiechartLayerOptions.NamedSlice>());
indicatorOptionGrid.addListener(Events.AfterEdit, new Listener<GridEvent<NamedSlice>>() {
@Override
public void handleEvent(GridEvent<NamedSlice> be) {
be.getModel().getSlice().setColor(be.getModel().getColor());
ValueChangeEvent.fire(PiechartLayerOptions.this, piechartMapLayer);
}
});
VBoxLayoutData vbld = new VBoxLayoutData();
vbld.setFlex(1);
panel.add(indicatorOptionGrid);
}
use of com.extjs.gxt.ui.client.event.GridEvent in project activityinfo by bedatadriven.
the class HighlightingGridView method onRowOver.
@Override
protected void onRowOver(Element row) {
int index = findRowIndex(row);
if (index != -1) {
ModelData model = grid.getStore().getAt(index);
if (isHighlightable(model)) {
fly(row).addStyleName(IndicatorLinkResources.INSTANCE.style().highlight());
GridEvent event = new GridEvent(grid);
event.setModel(model);
grid.fireEvent(HighlightingGridView.ROW_MOUSE_OVER, event);
}
}
overRow = row;
}
Aggregations