Search in sources :

Example 1 with EditCheckColumnConfig

use of org.activityinfo.client.page.common.columns.EditCheckColumnConfig in project activityinfo by bedatadriven.

the class LockedPeriodGrid method createGrid.

private void createGrid() {
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig columnEnabled = new EditCheckColumnConfig("enabled", I18N.CONSTANTS.enabledColumn(), 55);
    columnEnabled.setSortable(false);
    ColumnConfig columnPeriodType = new ReadLockedPeriodTypeColumn();
    columnPeriodType.setSortable(false);
    configs.add(columnEnabled);
    configs.add(columnPeriodType);
    configs.add(new ReadTextColumn("parentName", I18N.CONSTANTS.parentName(), 150));
    configs.add(new ReadTextColumn("name", I18N.CONSTANTS.name(), 100));
    configs.add(new EditableLocalDateColumn("fromDate", I18N.CONSTANTS.fromDate(), 100));
    configs.add(new EditableLocalDateColumn("toDate", I18N.CONSTANTS.toDate(), 100));
    lockedPeriodGrid = new EditorGrid<LockedPeriodDTO>(lockedPeriodStore, new ColumnModel(configs));
    lockedPeriodGrid.addListener(Events.OnClick, new Listener<ComponentEvent>() {

        @Override
        public void handleEvent(ComponentEvent be) {
            lockedPeriod = lockedPeriodGrid.getSelectionModel().getSelectedItem();
            setDeleteEnabled(lockedPeriodGrid.getSelectionModel().getSelectedItem() != null);
        }
    });
    add(lockedPeriodGrid);
}
Also used : ReadLockedPeriodTypeColumn(org.activityinfo.client.page.common.columns.ReadLockedPeriodTypeColumn) EditCheckColumnConfig(org.activityinfo.client.page.common.columns.EditCheckColumnConfig) ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) ReadTextColumn(org.activityinfo.client.page.common.columns.ReadTextColumn) ArrayList(java.util.ArrayList) EditableLocalDateColumn(org.activityinfo.client.page.common.columns.EditableLocalDateColumn) EditCheckColumnConfig(org.activityinfo.client.page.common.columns.EditCheckColumnConfig) LockedPeriodDTO(org.activityinfo.shared.dto.LockedPeriodDTO) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel) ComponentEvent(com.extjs.gxt.ui.client.event.ComponentEvent)

Aggregations

ComponentEvent (com.extjs.gxt.ui.client.event.ComponentEvent)1 ColumnConfig (com.extjs.gxt.ui.client.widget.grid.ColumnConfig)1 ColumnModel (com.extjs.gxt.ui.client.widget.grid.ColumnModel)1 ArrayList (java.util.ArrayList)1 EditCheckColumnConfig (org.activityinfo.client.page.common.columns.EditCheckColumnConfig)1 EditableLocalDateColumn (org.activityinfo.client.page.common.columns.EditableLocalDateColumn)1 ReadLockedPeriodTypeColumn (org.activityinfo.client.page.common.columns.ReadLockedPeriodTypeColumn)1 ReadTextColumn (org.activityinfo.client.page.common.columns.ReadTextColumn)1 LockedPeriodDTO (org.activityinfo.shared.dto.LockedPeriodDTO)1