Search in sources :

Example 1 with ColumnModel

use of com.extjs.gxt.ui.client.widget.grid.ColumnModel in project activityinfo by bedatadriven.

the class DrillDownEditor method buildColumnModel.

private ColumnModel buildColumnModel() {
    List<ColumnConfig> config = new ArrayList<>();
    config.add(new ColumnConfig("database", I18N.CONSTANTS.database(), 100));
    config.add(new ColumnConfig("activity", I18N.CONSTANTS.activity(), 100));
    config.add(new ColumnConfig("partner", I18N.CONSTANTS.partner(), 100));
    config.add(new ColumnConfig("location", I18N.CONSTANTS.location(), 100));
    config.add(new ColumnConfig("date", I18N.CONSTANTS.date(), 100));
    config.add(new ColumnConfig("indicator", I18N.CONSTANTS.indicator(), 100));
    ColumnConfig valueColumn = new ColumnConfig("value", I18N.CONSTANTS.value(), 100);
    valueColumn.setNumberFormat(IndicatorNumberFormat.INSTANCE);
    valueColumn.setAlignment(Style.HorizontalAlignment.RIGHT);
    config.add(valueColumn);
    return new ColumnModel(config);
}
Also used : ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ArrayList(java.util.ArrayList) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Example 2 with ColumnModel

use of com.extjs.gxt.ui.client.widget.grid.ColumnModel in project activityinfo by bedatadriven.

the class DbPartnerEditor method createColumnModel.

private ColumnModel createColumnModel() {
    List<ColumnConfig> columns = new ArrayList<>();
    columns.add(new ColumnConfig("name", I18N.CONSTANTS.name(), 150));
    columns.add(new ColumnConfig("fullName", I18N.CONSTANTS.description(), 300));
    return new ColumnModel(columns);
}
Also used : ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ArrayList(java.util.ArrayList) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Example 3 with ColumnModel

use of com.extjs.gxt.ui.client.widget.grid.ColumnModel in project activityinfo by bedatadriven.

the class DbProjectGrid method createColumnModel.

protected ColumnModel createColumnModel() {
    List<ColumnConfig> columns = new ArrayList<>();
    columns.add(new ColumnConfig("name", messages.name(), 150));
    columns.add(new ColumnConfig("description", messages.description(), 300));
    return new ColumnModel(columns);
}
Also used : ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ArrayList(java.util.ArrayList) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Example 4 with ColumnModel

use of com.extjs.gxt.ui.client.widget.grid.ColumnModel in project activityinfo by bedatadriven.

the class SiteGridPanel method load.

public void load(final GroupingModel grouping, final Filter filter) {
    removeAll();
    add(new LoadingPlaceHolder());
    layout();
    columnModelProvider.fetchColumnModels(filter, grouping, new SuccessCallback<ColumnModel>() {

        @Override
        public void onSuccess(ColumnModel columnModel) {
            createGrid(grouping, filter, columnModel);
        }
    });
    updateHeading(filter);
}
Also used : LoadingPlaceHolder(org.activityinfo.ui.client.widget.legacy.LoadingPlaceHolder) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Example 5 with ColumnModel

use of com.extjs.gxt.ui.client.widget.grid.ColumnModel 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);
}
Also used : VBoxLayoutData(com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData) GridEvent(com.extjs.gxt.ui.client.event.GridEvent) ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ReadTextColumn(org.activityinfo.ui.client.page.common.columns.ReadTextColumn) ArrayList(java.util.ArrayList) EditColorColumn(org.activityinfo.ui.client.page.common.columns.EditColorColumn) EditorGrid(com.extjs.gxt.ui.client.widget.grid.EditorGrid) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel)

Aggregations

ColumnModel (com.extjs.gxt.ui.client.widget.grid.ColumnModel)6 ColumnConfig (com.extjs.gxt.ui.client.widget.grid.ColumnConfig)5 ArrayList (java.util.ArrayList)5 GridEvent (com.extjs.gxt.ui.client.event.GridEvent)1 NumberField (com.extjs.gxt.ui.client.widget.form.NumberField)1 CellEditor (com.extjs.gxt.ui.client.widget.grid.CellEditor)1 EditorGrid (com.extjs.gxt.ui.client.widget.grid.EditorGrid)1 VBoxLayoutData (com.extjs.gxt.ui.client.widget.layout.VBoxLayoutData)1 EditColorColumn (org.activityinfo.ui.client.page.common.columns.EditColorColumn)1 ReadTextColumn (org.activityinfo.ui.client.page.common.columns.ReadTextColumn)1 LoadingPlaceHolder (org.activityinfo.ui.client.widget.legacy.LoadingPlaceHolder)1