private Grid<BeanModel> createGrid() {
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig column = new ColumnConfig();

    configs.add(selectionMode.getColumn());

    column.setId("no");
    column.setHeader("序号");
    column.setWidth(100);
    column.setRowHeader(true);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("name");
    column.setHeader("成品名称");
    column.setWidth(226);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("goodModel");
    column.setHeader("规格、型号");
    column.setWidth(226);
    configs.add(column);

    column = new ColumnConfig();
    column.setNumberFormat(NumberFormat.getCurrencyFormat(new MyCurrencyData()));
    column.setId("processFee");
    column.setHeader("加工费(单价)");
    column.setWidth(100);
    configs.add(column);

    store.setMonitorChanges(true);
    Grid<BeanModel> grid = new Grid<BeanModel>(store, new ColumnModel(configs));
    grid.setSelectionModel(selectionMode);
    grid.addPlugin(selectionMode);
    return grid;
  }
  private Grid<BeanModel> createGrid() {
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig column = new ColumnConfig();

    column.setId("containerNo");
    column.setHeader("集装箱号");
    column.setWidth(100);
    column.setRowHeader(true);
    configs.add(column);

    GridCellRenderer<BeanModel> sizeCellRenderer =
        new GridCellRenderer<BeanModel>() {

          @Override
          public Object render(
              BeanModel model,
              String property,
              ColumnData config,
              int rowIndex,
              int colIndex,
              ListStore<BeanModel> store,
              Grid<BeanModel> grid) {
            String code = model.get(property);
            ContainerSize containerSize = containerSizeStore.findModel("code", code).getBean();
            return containerSize.getSize();
          }
        };

    column = new ColumnConfig();
    column.setRenderer(sizeCellRenderer);
    column.setId("size");
    column.setHeader("尺寸");
    column.setWidth(100);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("valentNum");
    column.setHeader("标准箱个数");
    column.setWidth(100);
    configs.add(column);

    ColumnModel cm = new ColumnModel(configs);

    AggregationRowConfig<BeanModel> statistics = new AggregationRowConfig<BeanModel>();
    statistics.setHtml("containerNo", "统计");

    statistics.setSummaryType("size", SummaryType.COUNT);
    statistics.setRenderer(
        "size",
        new AggregationRenderer<BeanModel>() {
          public Object render(
              Number value, int colIndex, Grid<BeanModel> grid, ListStore<BeanModel> store) {
            return "集装箱" + ContainerTabItem.this.store.getCount() + "个";
          }
        });

    statistics.setSummaryType("valentNum", SummaryType.SUM);
    statistics.setRenderer(
        "valentNum",
        new AggregationRenderer<BeanModel>() {
          public Object render(
              Number value, int colIndex, Grid<BeanModel> grid, ListStore<BeanModel> store) {
            if (value == null) {
              return "";
            }
            return "标准箱" + value.intValue() + "个";
          }
        });
    cm.addAggregationRow(statistics);

    store.setMonitorChanges(true);
    Grid<BeanModel> grid = new Grid<BeanModel>(store, cm);
    grid.setView(
        new GridView() {
          @Override
          protected void afterRender() {
            refresh(true);
          }
        });
    grid.setBorders(true);

    return grid;
  }