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);
}
Aggregations