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

Examples of com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar


    filters.setLocal(Boolean.FALSE);
    this.addPlugin(filters);

    // Establecemos una barra de herramientas y la relacionamos con el
    // loader actual
    toolBar = new PagingToolBar(pageSize);
    toolBar.bind(loader);

    setStateId("pagingGridExample");
    setStateful(Boolean.TRUE);
View Full Code Here


  public void onTab(Component component, PreviewEvent pe) {
    if (!isManaged()) return;

    boolean paging = component.getParent() instanceof PagingToolBar;
    if (paging) {
      PagingToolBar bar = (PagingToolBar) component.getParent();
      int idx = bar.indexOf(component);
      int fa = firstActive(bar);
      int la = lastActive(bar);
      if ((pe.isShiftKey() && idx > fa) || (!pe.isShiftKey() && idx < (la - 1))) {
        super.onTab(component, pe);
        return;
View Full Code Here

      collapse();
    }
  }

  protected PagingToolBar createPagingToolBar(int pageSize) {
    return new PagingToolBar(pageSize);
  }
View Full Code Here

    loader.setRemoteSort(true);

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

    final PagingToolBar toolBar = new PagingToolBar(500);
    toolBar.bind(loader);

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

    RowNumberer rn = new RowNumberer();
    rn.setWidth(30);
View Full Code Here

        proxy, new BeanModelReader());
    loader.setRemoteSort(true);

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

    final PagingToolBar toolBar = new PagingToolBar(50);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(new ColumnConfig("forum", "Forum", 150));
    columns.add(new ColumnConfig("username", "Username", 100));
    columns.add(new ColumnConfig("subject", "Subject", 200));
View Full Code Here

        proxy);
    loader.setRemoteSort(true);

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

    final PagingToolBar toolBar = new PagingToolBar(50);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    columns.add(new ColumnConfig("forum", "Forum", 150));
    columns.add(new ColumnConfig("username", "Username", 100));
    columns.add(new ColumnConfig("subject", "Subject", 200));
View Full Code Here

    PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
    loader.setRemoteSort(true);

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

    final PagingToolBar toolBar = new PagingToolBar(10);
    toolBar.bind(loader);

    loader.load(0, 10);

    final NumberFormat currency = NumberFormat.getCurrencyFormat();
    final NumberFormat number = NumberFormat.getFormat("0.00");
    final NumberCellRenderer<Grid<Stock>> numberRenderer = new NumberCellRenderer<Grid<Stock>>(currency);

    GridCellRenderer<Stock> change = new GridCellRenderer<Stock>() {
      public String render(Stock model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<Stock> store, Grid<Stock> grid) {
        double val = (Double) model.get(property);
        String style = val < 0 ? "red" : "green";
        return "<span style='color:" + style + "'>" + number.format(val) + "</span>";
      }
    };

    GridCellRenderer<Stock> gridNumber = new GridCellRenderer<Stock>() {
      public String render(Stock model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<Stock> store, Grid<Stock> grid) {
        return numberRenderer.render(null, property, model.get(property));
      }
    };

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

    ColumnConfig column = new ColumnConfig();
    column.setId("name");
    column.setHeader("Company");
    column.setWidth(200);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("symbol");
    column.setHeader("Symbol");
    column.setWidth(100);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("last");
    column.setHeader("Last");
    column.setAlignment(HorizontalAlignment.RIGHT);
    column.setWidth(75);
    column.setRenderer(gridNumber);
    configs.add(column);

    column = new ColumnConfig("change", "Change", 100);
    column.setAlignment(HorizontalAlignment.RIGHT);
    column.setRenderer(change);
    configs.add(column);

    column = new ColumnConfig("date", "Last Updated", 100);
    column.setAlignment(HorizontalAlignment.RIGHT);
    column.setDateTimeFormat(DateTimeFormat.getFormat("MM/dd/yyyy"));
    configs.add(column);

    ColumnModel cm = new ColumnModel(configs);

    ContentPanel cp = new ContentPanel();
    cp.setFrame(true);
    cp.setHeading("Local Paging Grid");
    cp.setIcon(Resources.ICONS.table());
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.setLayout(new FitLayout());
    cp.setBottomComponent(toolBar);
    cp.setSize(600, 200);

    Grid<Stock> grid = new Grid<Stock>(store, cm);
    grid.setBorders(true);
    grid.setAutoExpandColumn("name");
    grid.getAriaSupport().setDescribedBy(toolBar.getId() + "-display");

    cp.add(grid);

    add(cp);
  }
View Full Code Here

    grid.setStripeRows(true);
    grid.setColumnLines(true);
    grid.addPlugin(filters);
    cp.add(grid);

    final PagingToolBar toolBar = new PagingToolBar(25);
    toolBar.bind(loader);

    cp.setBottomComponent(toolBar);

    add(cp);
  }
View Full Code Here

        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);
        toolBar.bind(loader);

        userGrid = new Grid<GWTJahiaUser>(store, cm);
        if (singleSelectionMode) {
            userGrid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        }
View Full Code Here

        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);

        groupGrid = new Grid<GWTJahiaGroup>(store, cm);
        if (singleSelectionMode) {
            groupGrid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar

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.