Package com.extjs.gxt.ui.client.widget.grid

Examples of com.extjs.gxt.ui.client.widget.grid.ColumnModel


@SuppressWarnings("rawtypes")
public class TreeGrid extends
    com.extjs.gxt.ui.client.widget.treegrid.TreeGrid {

  public TreeGrid(String serviceName, List<ColumnConfig> configs) {
    super(new TreeStore(new TreeLoader(serviceName, null))new ColumnModel(configs));
    setBorders(true)
    getStyle().setNodeCloseIcon(Resources.ICONS.folder());
    getStyle().setNodeOpenIcon(Resources.ICONS.folderExplorer());
      getStyle().setLeafIcon(Resources.ICONS.page())
      //setAutoExpandColumn(ParamsConst.PATH); 
View Full Code Here


  protected void onLoadSuccess(Object loadConfig, List result) {
    ArrayList list = new ArrayList();
    Iterator itList = result.iterator();
    while (itList.hasNext()) {
      Map actual = (Map) itList.next();
      ColumnModel model = ((TreeGridProxy)this.getProxy()).getCallback().getGrid().getColumnModel();
      BaseTreeModel baseModel;
      if (Boolean.TRUE.equals(actual.get(ParamsConst.IS_DIRECTORY))) {
        Context.getInstance().addDetailExecution("Instanciando Folder");
        baseModel = new Folder();
      } else {
        Context.getInstance().addDetailExecution("Instanciando Music");
        baseModel = new Music();
      }
      List columns = model.getColumns();
      Iterator it = columns.iterator();
      while (it.hasNext()) {
        ColumnConfig columnConfig = (ColumnConfig) it.next();
        baseModel.set(columnConfig.getId(), actual.get(columnConfig.getId()));
      }
View Full Code Here

      }
    }
   
    //End

    ColumnModel cm = new ColumnModel(columns);
    cm.addAggregationRow(totalSummary);

    ColumnConfig column = cm.getColumn(0);
    column.setRenderer(createDeleteButtonRenderer());

    column = cm.getColumn(1);
    column.setRenderer(new GridCellRenderer<ProgressDto>() {
      @Override
      public Object render(ProgressDto model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<ProgressDto> store, Grid<ProgressDto> grid) {
        return rowIndex + 1;
      }
    });

    column = cm.getColumn(2);
    column.setRenderer(createTextFieldRenderer(column.getWidth() - PADDING_2));
    column.setEditor(new CellEditor(createTextField(MAX_LENGTH_3)));

    column = cm.getColumn(3);
    column.setRenderer(createDateRenderer(column.getWidth() - PADDING_2));

    column = cm.getColumn(4);
    column.setRenderer(createNumberRenderer(column.getWidth() - PADDING_2));
    column.setEditor(new CellEditor(createNumberField(null)));

    column = cm.getColumn(5);
    column.setNumberFormat(NumberFormat.getFormat(NUMBER_FORMAT));

    column = cm.getColumn(6);
    column.setRenderer(createNumberRenderer(column.getWidth() - PADDING_2));
    column.setEditor(new CellEditor(createNumberField(null)));

    column = cm.getColumn(7);
    column.setNumberFormat(NumberFormat.getFormat(NUMBER_FORMAT));

    cm.addHeaderGroup(0, 4, new HeaderGroupConfig(messages.avancement(), 1, 2));
    cm.addHeaderGroup(0, 6, new HeaderGroupConfig(messages.retenues(), 1, 2));
   
    ListStore<ProgressDto> store = new ListStore<ProgressDto>();
    progressGrid = new CustomEditorGrid<ProgressDto>(store, cm);
    progressGrid.setAutoHeight(true);
    progressGrid.getView().setForceFit(true);
View Full Code Here

  private void createPenaltiesGrid() {
    String[] headers = { "", messages.amount(), messages.pourcentageDuRegularise() };
    String[] ids = { AnonymousDto.COLUMN_1, AnonymousDto.COLUMN_2, AnonymousDto.COLUMN_3 };
    int[] columnsWidth = { 250, 200, 280 };
    HorizontalAlignment[] horizontalAlignments = { HorizontalAlignment.CENTER, HorizontalAlignment.RIGHT, HorizontalAlignment.RIGHT };
    ColumnModel cm = createColumnModel(headers, ids, columnsWidth, horizontalAlignments);

    cm.getColumn(0).setRenderer(new GridCellRenderer<AnonymousDto>() {
      @Override
      public Object render(AnonymousDto model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<AnonymousDto> store, Grid<AnonymousDto> grid) {
        config.style = "background-color: " + HEADER_BACKGROUND_COLOR + ";";
        return "<center><label>" + model.get(property) + "</label></center>";
      }
    });

    cm.getColumn(1).setNumberFormat(NumberFormat.getFormat(NUMBER_FORMAT));
    cm.getColumn(2).setNumberFormat(NumberFormat.getPercentFormat());

    ListStore<AnonymousDto> store = new ListStore<AnonymousDto>();
    penaltyGrid = new CustomEditorGrid<AnonymousDto>(store, cm);
    penaltyGrid.setAutoHeight(true);
    penaltyGrid.getView().setForceFit(true);
View Full Code Here

    String[] headers = { "", messages.canto(), messages.badge(), messages.grue(), messages.lift(), messages.benne(), messages.nettoyage(), messages.autres() };
    String[] ids = { AnonymousDto.COLUMN_1, AnonymousDto.COLUMN_2, AnonymousDto.COLUMN_3, AnonymousDto.COLUMN_4, AnonymousDto.COLUMN_5, AnonymousDto.COLUMN_6, AnonymousDto.COLUMN_7, AnonymousDto.COLUMN_8 };
    int width = 90;
    int[] columnsWidth = { 150, width, width, width, width, width, width, width };
    HorizontalAlignment[] horizontalAlignments = { HorizontalAlignment.CENTER };
    ColumnModel cm = createColumnModel(headers, ids, columnsWidth, horizontalAlignments);

    cm.getColumn(0).setRenderer(new GridCellRenderer<AnonymousDto>() {
      @Override
      public Object render(AnonymousDto model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<AnonymousDto> store, Grid<AnonymousDto> grid) {
        config.style = "background-color: " + HEADER_BACKGROUND_COLOR + ";";
        return "<label>" + model.get(property) + "</label>";
View Full Code Here

    NumberField numberField = createNumberField(null);
    column3.setEditor(new CellEditor(numberField));
    column3.setRenderer(numberRenderer);
    configs.add(column3);

    ColumnModel cm = new ColumnModel(configs);

    ListStore<CautionFournieDto> data = new ListStore<CautionFournieDto>();
    cautionFournieGrid = new CustomEditorGrid<CautionFournieDto>(data, cm);
    cautionFieldset.add(cautionFournieGrid, new RowData(Style.DEFAULT, 145.0, new Margins()));
   
View Full Code Here

          column.setEditor(new CellEditor(createLockNumberFieldWithPermission(null, role, user)));
        }
      }
    }

    ColumnModel cm = new ColumnModel(columns);
    cm.addAggregationRow(totalSummary);

    // Heading groups
    cm.addHeaderGroup(0, 1, new HeaderGroupConfig(messages.sousTraitant().toUpperCase(), 1, 3));
    cm.addHeaderGroup(0, 4, new HeaderGroupConfig(messages.budgetConforme().toUpperCase(), 1, 5));
    cm.addHeaderGroup(0, 9, new HeaderGroupConfig(messages.suiviTraite().toUpperCase(), 1, 6));
    cm.addHeaderGroup(0, 15, new HeaderGroupConfig("ECARTS", 1, 5));
    cm.addHeaderGroup(0, 20, new HeaderGroupConfig("AVANCEMENT / MARCHE", 1, 4));
    cm.addHeaderGroup(0, 24, new HeaderGroupConfig("RETENUES APPLIQUEES", 1, 11));
    cm.addHeaderGroup(0, 35, new HeaderGroupConfig("PRORATA / VARIATION", 1, 7));
    SummaryColumnConfig actionsColumn = (SummaryColumnConfig) cm.getColumnById(FicheStDto.ID);
    actionsColumn.setRenderer(createActionButtonsRenderer());

    String groupingColumnId = combineProps(FicheStDto.LOT_TYPE, LotTypeDto.NAME);
    SummaryColumnConfig<Number> groupingColumn = new SummaryColumnConfig<Number>(groupingColumnId, "Lot<br>type", 50);
    cm.getColumns().add(groupingColumn);

    GroupingStore<FicheStDto> store = new GroupingStore<FicheStDto>();
    store.groupBy(groupingColumnId);

    GroupSummaryView view = new GroupSummaryView();
View Full Code Here

        totalSummary.setSummaryType(columnId, SummaryType.SUM);
        totalSummary.setSummaryFormat(columnId, NumberFormat.getCurrencyFormat());
      }
    }

    ColumnModel cm = new ColumnModel(columns);
    cm.addAggregationRow(totalSummary);

    // Heading groups
    cm.addHeaderGroup(0, 1, new HeaderGroupConfig("Objectif".toUpperCase(), 1, 1));
    cm.addHeaderGroup(0, 2, new HeaderGroupConfig(messages.budgetConforme().toUpperCase(), 1, 5));
    cm.addHeaderGroup(0, 7, new HeaderGroupConfig(messages.suiviTraite().toUpperCase(), 1, 6));
    cm.addHeaderGroup(0, 13, new HeaderGroupConfig("ECARTS", 1, 5));
    cm.addHeaderGroup(0, 18, new HeaderGroupConfig("AVANCEMENT / MARCHE", 1, 4));
    cm.addHeaderGroup(0, 22, new HeaderGroupConfig("RETENUES APPLIQUEES", 1, 11));
    cm.addHeaderGroup(0, 33, new HeaderGroupConfig("PRORATA / VARIATION", 1, 6));

    GroupingStore<FicheStDto> store = new GroupingStore<FicheStDto>();
    GroupSummaryView view = new GroupSummaryView();
    view.setShowGroupedColumn(false);
View Full Code Here

    HorizontalAlignment[] horizontalAlignments = { HorizontalAlignment.CENTER };

    AggregationRowConfig<TransfertPpSummaryDto> totalSummary = new AggregationRowConfig<TransfertPpSummaryDto>();
    totalSummary.setHtml(TransfertPpSummaryDto.LABEL, "Total PP".toUpperCase());

    ColumnModel cm = createColumnModel(headers, ids, columnsWidth, horizontalAlignments);
    transfertPpGrid = new CustomEditorGrid(new ListStore<TransfertPpSummaryDto>(), cm);
    transfertPpGrid.getView().setAutoFill(true);

    List<String> summaryColumns = Arrays.asList(
        TransfertPpSummaryDto.OBJECTIVE, TransfertPpSummaryDto.OBJ, TransfertPpSummaryDto.DEVERS,
        TransfertPpSummaryDto.RD, TransfertPpSummaryDto.TS, TransfertPpSummaryDto.TOTAL);

    for( String columnId : summaryColumns ) {
      ColumnConfig column = cm.getColumnById(columnId);
      column.setNumberFormat(NumberFormat.getFormat(NUMBER_FORMAT));
      totalSummary.setSummaryType(columnId, SummaryType.SUM);
      totalSummary.setSummaryFormat(columnId, NumberFormat.getCurrencyFormat());
    }
    cm.addAggregationRow(totalSummary);

    cm.getColumnById(TransfertPpSummaryDto.ID).setRenderer(new GridCellRenderer<TransfertPpSummaryDto>() {
      @Override
      public Object render(final TransfertPpSummaryDto model, String property,
          com.extjs.gxt.ui.client.widget.grid.ColumnData config, int rowIndex, int colIndex,
          ListStore<TransfertPpSummaryDto> store, Grid<TransfertPpSummaryDto> grid) {

        Image viewButton = createViewButton();
        viewButton.addClickHandler(new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            // bus.fireEvent(new LoadTransfertppSummaryDtoEvent(model));
            GuiUtil.gotoEcran(new TransfertppEcran(chantier, model.getRefTransfertPpId(), role, user));
          }
        });
        return viewButton;
      }
    });

    ColumnConfig objectiveColumn = cm.getColumnById(TransfertPpSummaryDto.OBJECTIVE);
    objectiveColumn.setRenderer(createNumberRendererWithPermission(objectiveColumn.getWidth() - PADDING, role, user));
    objectiveColumn.setEditor(new CellEditor(createLockNumberFieldWithPermission(null, role, user)));
    transfertPpGrid.setAutoHeight(true);
    loadTransfertPpData();
  }
View Full Code Here

      }
  });
  configs.add(column_1);

  ColumnModel cm = new ColumnModel(configs);
  gridAdmin = new Grid<UtilisateurGrpModel>(userStore, cm);
  gridAdmin.setAutoExpandMax(800);
  gridAdmin.setAutoExpandMin(300);
  gridAdmin.setColumnReordering(true);
  gridAdmin.setColumnLines(true);
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.grid.ColumnModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.