Search in sources :

Example 1 with CheckColumnConfig

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

the class ShareReportDialog method createColumnModel.

private ColumnModel createColumnModel() {
    ColumnConfig icon = new ColumnConfig("icon", "", 26);
    icon.setSortable(false);
    icon.setResizable(false);
    icon.setMenuDisabled(true);
    icon.setRenderer(new GridCellRenderer<ReportVisibilityDTO>() {

        @Override
        public Object render(ReportVisibilityDTO model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ReportVisibilityDTO> store, Grid<ReportVisibilityDTO> grid) {
            return IconImageBundle.ICONS.group().getHTML();
        }
    });
    ColumnConfig name = new ColumnConfig("databaseName", I18N.CONSTANTS.group(), 150);
    name.setRenderer(new GridCellRenderer<ReportVisibilityDTO>() {

        @Override
        public Object render(ReportVisibilityDTO model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ReportVisibilityDTO> store, Grid<ReportVisibilityDTO> grid) {
            return model.getDatabaseName() + " Users";
        }
    });
    visibleColumn = new CheckColumnConfig("visible", I18N.CONSTANTS.shared(), 75);
    visibleColumn.setDataIndex("visible");
    dashboardColumn = new CheckColumnConfig("defaultDashboard", I18N.CONSTANTS.defaultDashboard(), 75);
    dashboardColumn.setDataIndex("defaultDashboard");
    ColumnModel columnModel = new ColumnModel(Arrays.asList(icon, name, visibleColumn, dashboardColumn));
    return columnModel;
}
Also used : ReportVisibilityDTO(org.activityinfo.shared.dto.ReportVisibilityDTO) ColumnConfig(com.extjs.gxt.ui.client.widget.grid.ColumnConfig) CheckColumnConfig(com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig) ColumnData(com.extjs.gxt.ui.client.widget.grid.ColumnData) ColumnModel(com.extjs.gxt.ui.client.widget.grid.ColumnModel) CheckColumnConfig(com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig)

Aggregations

CheckColumnConfig (com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig)1 ColumnConfig (com.extjs.gxt.ui.client.widget.grid.ColumnConfig)1 ColumnData (com.extjs.gxt.ui.client.widget.grid.ColumnData)1 ColumnModel (com.extjs.gxt.ui.client.widget.grid.ColumnModel)1 ReportVisibilityDTO (org.activityinfo.shared.dto.ReportVisibilityDTO)1