Search in sources :

Example 6 with ColumnModel

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

the class MonthlyGrid method createColumnModel.

private static ColumnModel createColumnModel() {
    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    ColumnConfig indicator = new ColumnConfig("indicatorName", I18N.CONSTANTS.indicators(), ROW_HEADER_WIDTH);
    indicator.setSortable(false);
    indicator.setMenuDisabled(true);
    columns.add(indicator);
    for (int i = 0; i != MONTHS_TO_SHOW; ++i) {
        NumberField indicatorField = new NumberField();
        indicatorField.getPropertyEditor().setFormat(IndicatorNumberFormat.INSTANCE);
        ColumnConfig valueColumn = new ColumnConfig("month" + i, "", MONTH_COLUMN_WIDTH);
        valueColumn.setNumberFormat(IndicatorNumberFormat.INSTANCE);
        valueColumn.setEditor(new CellEditor(indicatorField));
        valueColumn.setSortable(false);
        valueColumn.setMenuDisabled(true);
        columns.add(valueColumn);
    }
    return new ColumnModel(columns);
}
Also used : ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) CellEditor(com.extjs.gxt.ui.client.widget.grid.CellEditor) ArrayList(java.util.ArrayList) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel) NumberField(com.extjs.gxt.ui.client.widget.form.NumberField)

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