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

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


                        store.add(result);
                    }
                });

        List<ColumnConfig> columns = new ArrayList<ColumnConfig>(2);
        columns.add(new ColumnConfig("displayName", Messages.get("label.portletName", "Name"), 180));
        columns.add(new ColumnConfig("description", Messages.get("label.portletDescription", "Description"), 400));

        ColumnModel cm = new ColumnModel(columns);
        Grid<GWTJahiaPortletDefinition> grid = new Grid<GWTJahiaPortletDefinition>(store, cm);
        grid.setSize(700, 300);
        grid.setBorders(true);
View Full Code Here


                        final ListStore<GWTJahiaWorkflowType> types = new ListStore<GWTJahiaWorkflowType>();
                        types.add(new ArrayList<GWTJahiaWorkflowType>(workflowRules.keySet()));
                        types.sort("displayName", Style.SortDir.ASC);

                        ColumnModel header = new ColumnModel(Arrays.asList(new ColumnConfig("displayName", "displayName", 300)));

                        final Grid<GWTJahiaWorkflowType> grid = new Grid<GWTJahiaWorkflowType>(types, header);
                        grid.setWidth(250);
                        grid.setHideHeaders(true);
                        grid.setHeight(150);
View Full Code Here

        List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

        RowNumberer rowNumberer = new RowNumberer();
        configs.add(rowNumberer);

        ColumnConfig column = new ColumnConfig();
        column.setId("type");
        column.setAlignment(HorizontalAlignment.CENTER);
        column.setWidth(40);
        column.setRenderer(new GridCellRenderer<WCAGViolation>() {
            public Object render(WCAGViolation model, String property, ColumnData config,
                                 int rowIndex, int colIndex, ListStore<WCAGViolation> store,
                                 Grid<WCAGViolation> grid) {
                Html html = null;
                if ("warning".equalsIgnoreCase(model.getType())) {
                    html = new Html(StandardIconsProvider.STANDARD_ICONS.warning().getHTML());
                    html.setToolTip(Messages.get("label.warning", "Warning"));
                } else if ("information".equalsIgnoreCase(model.getType())) {
                    html = new Html(StandardIconsProvider.STANDARD_ICONS.information().getHTML());
                    html.setToolTip(Messages.get("label.information", "Information"));
                } else {
                    html = new Html(StandardIconsProvider.STANDARD_ICONS.error().getHTML());
                    html.setToolTip(Messages.get("label.error", "Error"));
                }

                return html;
            }
        });
        configs.add(column);

        column = new ColumnConfig();
        column.setId("line");
        column.setHeader(Messages.get("label.line", "Line"));
        column.setWidth(50);
        configs.add(column);

        column = new ColumnConfig();
        column.setId("column");
        column.setHeader(Messages.get("label.column", "Column"));
        column.setWidth(50);
        configs.add(column);

        column = new ColumnConfig();
        column.setId("message");
        column.setHeader(Messages.get("label.description", "Description"));
        column.setRenderer(new GridCellRenderer<WCAGViolation>() {
            public Object render(WCAGViolation model, String property, ColumnData config,
                                 int rowIndex, int colIndex, ListStore<WCAGViolation> store,
                                 Grid<WCAGViolation> grid) {
                Text txt = new Text(model.getMessage());
                txt.setToolTip(model.getMessage());

                return txt;
            }
        });
        configs.add(column);

        column = new ColumnConfig();
        column.setId("context");
        column.setHeader(Messages.get("label.context", "Context"));
        column.setWidth(60);
        column.setAlignment(HorizontalAlignment.CENTER);
        column.setRenderer(new GridCellRenderer<WCAGViolation>() {
            public Object render(WCAGViolation model, String property, ColumnData config,
                                 int rowIndex, int colIndex, ListStore<WCAGViolation> store,
                                 Grid<WCAGViolation> grid) {
                if (model.getContext() == null || model.getContext().length() == 0) {
                    return "";
                }

                ToolTipConfig tt = new ToolTipConfig();
                tt.setTitle(Messages.get("label.context", "Context"));
                tt.setTemplate(new Template(model.getContext()));
                Html icon = new Html(StandardIconsProvider.STANDARD_ICONS.about().getHTML());
                icon.setToolTip(tt);

                return icon;
            }
        });
        configs.add(column);

        column = new ColumnConfig();
        column.setId("code");
        column.setHeader(Messages.get("label.code", "Code"));
        column.setWidth(60);
        column.setAlignment(HorizontalAlignment.CENTER);
        column.setRenderer(new GridCellRenderer<WCAGViolation>() {
            public Object render(WCAGViolation model, String property, ColumnData config,
                                 int rowIndex, int colIndex, ListStore<WCAGViolation> store,
                                 Grid<WCAGViolation> grid) {
                if (model.getCode() == null || model.getCode().length() == 0) {
                    return "";
                }

                ToolTipConfig tt = new ToolTipConfig();
                tt.setTitle(Messages.get("label.code", "Code"));
                tt.setTemplate(new Template(model.getCode()));
                Html icon = new Html(StandardIconsProvider.STANDARD_ICONS.about().getHTML());
                icon.setToolTip(tt);

                return icon;
            }
        });
        configs.add(column);

        column = new ColumnConfig();
        column.setId("example");
        column.setHeader(Messages.get("label.example", "Example"));
        column.setAlignment(HorizontalAlignment.CENTER);
        column.setWidth(80);
        configs.add(column);

        ListStore<WCAGViolation> store = new ListStore<WCAGViolation>();
        store.add(wcagResult.getErrors());
        store.add(wcagResult.getWarnings());
View Full Code Here

//      }; 
   
    setHeading("Holdings");
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
   
    ColumnConfig clmncnfgStockName = new ColumnConfig("stockName", "Stock", 150);
    configs.add(clmncnfgStockName);
   
    ColumnConfig clmncnfgQuantity = new ColumnConfig("quantity", "Quantity", 150);
    configs.add(clmncnfgQuantity);
   
    ColumnConfig clmncnfgPrice = new ColumnConfig("price", "Price", 150);
    configs.add(clmncnfgPrice);

    Grid grid = new Grid(holdings, new ColumnModel(configs));
    add(grid, new FormData("100%"));
    grid.setBorders(true);
View Full Code Here

    public UserTable()
    {
        store = new ListStore<UserTableModel>();
       
        List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
        ColumnConfig column = new ColumnConfig();
       
        column = new ColumnConfig();
        column.setId("name");
        column.setHeader("Name");
        column.setWidth(150);
        configs.add(column);
       
        column = new ColumnConfig();
        column.setId("min");
        column.setHeader("Min");
        column.setWidth(75);
        configs.add(column);
       
        column = new ColumnConfig();
        column.setId("max");
        column.setHeader("Max");
        column.setWidth(75);
        configs.add(column);
       
        column = new ColumnConfig();
        column.setId("step");
        column.setHeader("Step");
        column.setWidth(75);
        configs.add(column);
       
        column = new ColumnConfig();
        column.setId("date");
        column.setHeader("Saved");
        column.setDateTimeFormat(DateTimeFormat.getFormat("HH:mm:ss   dd.MM.yyyy"));
        column.setWidth(175);
        configs.add(column);
       
        column = new ColumnConfig();
        column.setId("equations");
        column.setHeader("Equations");
        column.setRenderer(buttonRenderer);
        column.setWidth(150);
        configs.add(column);
       
        columnModel = new ColumnModel(configs);
       
        grid = new Grid<UserTableModel>(store, columnModel);
View Full Code Here

   
   
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

   
    ColumnConfig clmncnfgOrderID = new ColumnConfig("orderID", "ID", 30);
    configs.add(clmncnfgOrderID);
   
    ColumnConfig clmncnfgStockName = new ColumnConfig("stockName", "Stock", 80);
    configs.add(clmncnfgStockName);
   
    ColumnConfig clmncnfgCustomer = new ColumnConfig("customerName", "Customer", 150);
    configs.add(clmncnfgCustomer);
   
    ColumnConfig clmncnfgPrice = new ColumnConfig("price", "Price", 60);
    configs.add(clmncnfgPrice);
   
    ColumnConfig clmncnfgQuantity = new ColumnConfig("quantity", "Quantity", 60);
    configs.add(clmncnfgQuantity);
   
    ColumnConfig clmncnfgType = new ColumnConfig("type", "Type", 60);
    configs.add(clmncnfgType);

    ColumnModel cm = new ColumnModel(configs);

    ordersGrid = new Grid<Order>(orders, cm);
View Full Code Here

//      }; 
   
    setHeading("Holdings");
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
   
    ColumnConfig clmncnfgStockName = new ColumnConfig("stockName", "Stock", 150);
    configs.add(clmncnfgStockName);
   
    ColumnConfig clmncnfgQuantity = new ColumnConfig("quantity", "Quantity", 60);
    configs.add(clmncnfgQuantity);
   
    ColumnConfig clmncnfgPrice = new ColumnConfig("price", "Price", 60);
    configs.add(clmncnfgPrice);

    ColumnModel cm = new ColumnModel(configs);
   
    grid = new Grid<Holding>(holdings, cm);
View Full Code Here

  }

  public void updateColumnHeadings() {
    int cols = grid.getColumnModel().getColumnCount();
    for (int i = 0; i < cols; i++) {
      ColumnConfig config = grid.getColumnModel().getColumn(i);
      if (!config.isHidden()) {
        Head h = grid.getView().getHeader().getHead(i);
        if (h != null && h.isRendered()) {
          Filter f = getFilter(config.getDataIndex());
          if (f != null) {
            h.el().setStyleName(filterStyle, f.isActive());
          }
        }
      }
View Full Code Here

    this.store = store;
  }

  protected Filter getMenuFilter(MenuEvent me) {
    MenuItem item = (MenuItem) me.getItem();
    ColumnConfig config = grid.getColumnModel().getColumn((Integer) item.getData("index"));
    return getFilter(config.getDataIndex());
  }
View Full Code Here

        return o.toString();
      }
    }
    Object val = m.get(property);

    ColumnConfig c = cm.getColumn(colIndex);

    if (val != null && c.getNumberFormat() != null) {
      Number n = (Number) val;
      NumberFormat nf = cm.getColumn(colIndex).getNumberFormat();
      val = nf.format(n.doubleValue());
    } else if (val != null && c.getDateTimeFormat() != null) {
      DateTimeFormat dtf = c.getDateTimeFormat();
      val = dtf.format((Date) val);
    }

    String text = null;
    if (val != null) {
View Full Code Here

TOP

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

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.