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

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


    GroupingStore<Stock> store = new GroupingStore<Stock>();
    store.add(TestData.getCompanies());
    store.groupBy("industry");

    ColumnConfig company = new ColumnConfig("name", "Company", 60);
    ColumnConfig price = new ColumnConfig("open", "Price", 20);
    ColumnConfig change = new ColumnConfig("change", "Change", 20);
    ColumnConfig industry = new ColumnConfig("industry", "Industry", 20);
    ColumnConfig last = new ColumnConfig("date", "Last Updated", 20);
    last.setDateTimeFormat(DateTimeFormat.getFormat("MM/dd/y"));

    List<ColumnConfig> config = new ArrayList<ColumnConfig>();
    config.add(company);
    config.add(price);
    config.add(change);
View Full Code Here


  }

  private void createGrid() {
    ListStore<ModelData> store = new ListStore<ModelData>();

    ColumnConfig name = new ColumnConfig("name", "Name", 100);
    ColumnConfig date = new ColumnConfig("author", "Author", 100);
    ColumnConfig size = new ColumnConfig("genre", "Genre", 100);

    ColumnModel cm = new ColumnModel(Arrays.asList(name, date, size));

    Grid<ModelData> grid = new Grid<ModelData>(store, cm);
    grid.setBorders(false);
View Full Code Here

  }

  private void createTreeGrid() {
    TreeStore<ModelData> store = new TreeStore<ModelData>();

    ColumnConfig name = new ColumnConfig("name", "Name", 100);
    name.setRenderer(new TreeGridCellRenderer<ModelData>());

    ColumnConfig date = new ColumnConfig("author", "Author", 100);
    ColumnConfig size = new ColumnConfig("genre", "Genre", 100);
    ColumnModel cm = new ColumnModel(Arrays.asList(name, date, size));

    TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
    tree.setBorders(false);
    tree.getStyle().setLeafIcon(Resources.ICONS.music());
View Full Code Here

    // grid
    NumberPropertyEditor npe = new NumberPropertyEditor(Integer.class);
    ArrayList<ColumnConfig> cols = new ArrayList<ColumnConfig>();

    ColumnConfig qtr = new ColumnConfig("month", "Month", 100);
    cols.add(qtr);
    qtr.setEditor(new CellEditor(new TextField<String>()));

    ColumnConfig alpha = new ColumnConfig("alphasales", "Alpha ($M)", 100);
    cols.add(alpha);
    NumberField nf = new NumberField();
    nf.setPropertyEditor(npe);
    alpha.setEditor(new CellEditor(nf));

    ColumnConfig beta = new ColumnConfig("betasales", "Beta ($M)", 100);
    cols.add(beta);
    nf = new NumberField();
    nf.setPropertyEditor(npe);
    beta.setEditor(new CellEditor(nf));

    ColumnConfig gamma = new ColumnConfig("gammasales", "Gamma ($M)", 100);
    cols.add(gamma);
    nf = new NumberField();
    nf.setPropertyEditor(npe);
    gamma.setEditor(new CellEditor(nf));

    ColumnModel cm = new ColumnModel(cols);

    teamSalesGrid = new EditorGrid<TeamSales>(store, cm);
    teamSalesGrid.getView().setForceFit(true);
View Full Code Here

    protected void onRender(Element parent, int index) {
        super.onRender(parent, index);
        setHeight(610);
        List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

        ColumnConfig column = new ColumnConfig();
        column.setId("url");
        column.setHeader(Messages.get("label_url", "URL"));
        TextField<String> text = new TextField<String>();
        text.setAllowBlank(false);
        text.setRegex("^/?(?!.*/{2,})[a-zA-Z_0-9\\-\\./]+$");
        text.setMaxLength(250);
        text.getMessages().setRegexText(Messages.get("failure.invalid.urlmapping.label", "The vanity URL can only contain letters, digits, dots (.), dashes (-) and no consecutive slashes (/)"));
        CellEditor ce = new CellEditor(text);
        ce.addListener(Events.BeforeComplete, new Listener<EditorEvent>() {
            public void handleEvent(EditorEvent be) {
                Window.alert((String) be.getValue());
                be.stopEvent();
            }
        });
        column.setEditor(ce);
        configs.add(column);

        final CheckColumnConfig defaultColumn;
        final CheckColumnConfig activeColumn;
        if (editable) {
            defaultColumn = new CheckColumnConfig("default", Messages.get("label.urlmapping.default", "Default"), 70);
            defaultColumn.setEditor(new CellEditor(new CheckBox()));
            activeColumn = new CheckColumnConfig("active", Messages.get("label.urlmapping.active", "Active"), 55);
            activeColumn.setEditor(new CellEditor(new CheckBox()));
        } else {
            defaultColumn = new CheckColumnConfig("default", Messages.get("label.urlmapping.default", "Default"), 70){
                protected String getCheckState(ModelData model, String property, int rowIndex,
                                               int colIndex) {
                    return "-disabled";
                }
            };
            activeColumn = new CheckColumnConfig("active", Messages.get("label.urlmapping.active", "Active"), 55){
                protected String getCheckState(ModelData model, String property, int rowIndex,
                                               int colIndex) {
                    return "-disabled";
                }
            };
        }

        configs.add(defaultColumn);
        configs.add(activeColumn);

        column = new ColumnConfig("actions", "", 100);
        column.setAlignment(HorizontalAlignment.CENTER);
        column.setRenderer(new GridCellRenderer<GWTJahiaUrlMapping>() {
            public Object render(GWTJahiaUrlMapping modelData, String s, ColumnData columnData, final int rowIndex,
                    final int colIndex, ListStore<GWTJahiaUrlMapping> listStore, Grid<GWTJahiaUrlMapping> grid) {
                Button button = new Button(Messages.get("label_remove", "Remove"),
                        new SelectionListener<ButtonEvent>() {
                            @Override
                            public void componentSelected(ButtonEvent buttonEvent) {
                                store.remove(store.getAt(rowIndex));
                            }
                        });
                button.setIcon(StandardIconsProvider.STANDARD_ICONS.minusRound());
                button.setEnabled(editable);
                return button;
            }
        });
        column.setFixed(true);
        configs.add(column);

        final RowEditor<GWTJahiaUrlMapping> re = new RowEditor<GWTJahiaUrlMapping>();

        // Add a cancel edit event listener to remove empty line
View Full Code Here

            }
        });


        List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
        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 = new Grid<GWTJahiaPortletDefinition>(store, cm);
        grid.setBorders(true);
        grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
View Full Code Here

    public ContentTypeTree(Map<GWTJahiaNodeType, List<GWTJahiaNodeType>> types) {
        store = new TreeStore<GWTJahiaNodeType>();
        setBorders(false);
        filldataStore(types);
        ColumnConfig name = new ColumnConfig("label", "Label", 400);
        name.setRenderer(new WidgetTreeGridCellRenderer() {
            @Override
            public Widget getWidget(ModelData modelData, String s, ColumnData columnData, int i, int i1,
                                    ListStore listStore, Grid grid) {
                Label label = new Label((String) modelData.get(s));
                GWTJahiaNodeType gwtJahiaNodeType = (GWTJahiaNodeType) modelData;
                HorizontalPanel panel = new HorizontalPanel();
//                panel.setWidth(width - 40);
                panel.setTableWidth("100%");
                TableData tableData;
                if (gwtJahiaNodeType != null) {
                    tableData = new TableData(Style.HorizontalAlignment.RIGHT, Style.VerticalAlignment.MIDDLE);
                    tableData.setWidth("5%");
                    panel.add(ContentModelIconProvider.getInstance().getIcon(gwtJahiaNodeType).createImage());
                    tableData = new TableData(Style.HorizontalAlignment.LEFT, Style.VerticalAlignment.MIDDLE);
                    tableData.setWidth("95%");
                } else {
                    tableData = new TableData(Style.HorizontalAlignment.LEFT, Style.VerticalAlignment.MIDDLE);
                    tableData.setWidth("100%");
                }
                panel.add(label, tableData);
                if (!"".equals(gwtJahiaNodeType.getDescription())) { panel.setToolTip(gwtJahiaNodeType.getDescription()); }
                panel.layout();
                return panel;
            }
        });
        treeGrid = new TreeGrid<GWTJahiaNodeType>(store, new ColumnModel(Arrays.asList(name)));
        treeGrid.setBorders(true);
        treeGrid.setAutoExpandColumn("label");
        treeGrid.getTreeView().setRowHeight(25);
        treeGrid.getTreeView().setForceFit(true);
        treeGrid.getTreeView().setBufferEnabled(true);
        treeGrid.getTreeView().setCacheSize(128);
        treeGrid.getTreeView().setScrollDelay(5);
        treeGrid.getStyle().setNodeCloseIcon(null);
        treeGrid.getStyle().setNodeOpenIcon(null);
        Layout layout = new BorderLayout();
        setLayout(layout);
       
        setBorders(false);
       
    filter = new StoreFilterField<GWTJahiaNodeType>() {
      @Override
      protected boolean doSelect(Store<GWTJahiaNodeType> store, GWTJahiaNodeType parent,
              GWTJahiaNodeType record, String property, String filter) {
        String name = record.getLabel();
        name = name.toLowerCase();
        return name.contains(filter.toLowerCase());
      }
    };
    filter.bind(store);
        filter.setHeight(18);
View Full Code Here

        }

        ListStore<GWTJahiaUser> store = new ListStore<GWTJahiaUser>(loader);

        List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
        columns.add(new ColumnConfig("userName", Messages.get("label.username", "User name"), 120));
        columns.add(new ColumnConfig("j:lastName", Messages.get("org.jahia.admin.lastName.label", "Last name"), 140));
        columns.add(new ColumnConfig("j:firstName", Messages.get("org.jahia.admin.firstName.label", "First name"), 140));
//        columns.add(new ColumnConfig("siteName", "Site name", 80));
        columns.add(new ColumnConfig("provider", Messages.get("column.provider.label", "Provider"), 80));
//        columns.add(new ColumnConfig("email", "Email", 100));

        ColumnModel cm = new ColumnModel(columns);

        final PagingToolBar toolBar = new PagingToolBar(15);
View Full Code Here

            panel.add(siteMenu);
        }
        ListStore<GWTJahiaGroup> store = new ListStore<GWTJahiaGroup>(loader);

        List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
        columns.add(new ColumnConfig("groupname", "Group name", 240));
        columns.add(new ColumnConfig("siteName", "Site name", 120));
        columns.add(new ColumnConfig("provider", "Provider", 120));

        ColumnModel cm = new ColumnModel(columns);

        final PagingToolBar toolBar = new PagingToolBar(15);
        toolBar.bind(loader);
View Full Code Here

    public EngineCards(EngineContainer mainContainer, Linker linker) {
        super(new BorderLayout());

        final ListStore<BaseModelData> store = new ListStore<BaseModelData>();
        ColumnModel header = new ColumnModel(Arrays.asList(new ColumnConfig("header", Messages.get("label.workflow.multipleWorkflowsToStart","Warning : There are multiple workflow involved in this action"), 300)));

        list = new Grid<BaseModelData>(store, header);
        list.setAutoExpandColumn("header");
        list.setAutoExpandMax(1200);
        list.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<BaseModelData>() {
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.