Package com.extjs.gxt.ui.client.event

Examples of com.extjs.gxt.ui.client.event.TableEvent


   * @param index the column index
   * @param sortDir the direction to sort (NONE, ASC, DESC)
   */
  public void sort(int index, SortDir sortDir) {
    if (rendered) {
      TableEvent te = new TableEvent(this);
      te.setColumnIndex(index);
      te.setSortDir(sortDir);
      if (fireEvent(Events.SortChange, te)) {
        getTableHeader().sort(index, sortDir);
        getView().sort(index, sortDir);
      }
    } else {
View Full Code Here


    }
  }

  @Override
  protected ComponentEvent createComponentEvent(Event event) {
    TableEvent te = new TableEvent(this);
    te.setEvent(event);
    if (view != null && event != null) {
      Element target = event.getEventTarget().cast();
      int idx = view.findRowIndex(target);
      if (idx != -1) {
        te.setItem(idx != -1 ? getItem(idx) : null);
        te.setCellIndex(view.findCellIndex(target));
      }
    }
    return te;
  }
View Full Code Here

  }

  @SuppressWarnings("rawtypes")
  @Override
  protected ContainerEvent createContainerEvent(TableItem item) {
    return new TableEvent(this, item);
  }
View Full Code Here

      return " ";
    }
  }

  protected void onKeyPress(TableEvent te) {
    TableEvent e = new TableEvent(this);
    e.setEvent(te.getEvent());
    e.setItem(te.getItem());
    fireEvent(Events.KeyPress, e);
  }
View Full Code Here

  }

  @Override
  protected ComponentEvent previewEvent(EventType type, ComponentEvent ce) {
    if (type == Events.Remove || type == Events.Add) {
      TableEvent te = (TableEvent) ce;
      te.setRowIndex(te.getIndex());
    }
    return super.previewEvent(type, ce);
  }
View Full Code Here

    int index = table.getView().findCellIndex(target);
    if (index == Style.DEFAULT) {
      return;
    }

    TableEvent te = new TableEvent(table);
    te.setItem(this);
    te.setRowIndex(table.indexOf(this));
    te.setColumnIndex(index);
    te.setEvent(ce.getEvent());

    table.fireEvent(Events.CellClick, te);
    table.fireEvent(Events.RowClick, te);
  }
View Full Code Here

    int index = table.getView().findCellIndex(target);
    if (index == Style.DEFAULT) {
      return;
    }
    TableEvent evt = new TableEvent(table);
    evt.setItem(this);
    evt.setRowIndex(table.indexOf(this));
    evt.setCellIndex(index);

    table.fireEvent(Events.CellDoubleClick, evt);
    table.fireEvent(Events.RowDoubleClick, evt);
  }
View Full Code Here

   * @param width the new width
   */
  public void setColumnWidth(int index, float width) {
    TableColumn col = getColumn(index);
    col.setWidth(width);
    TableEvent ce = new TableEvent((Table) table);
    ce.setColumnIndex(index);
    ce.setTableWidth(width);
    fireEvent(Events.Resize);
  }
View Full Code Here

      TreeTableEvent tte = new TreeTableEvent((TreeTable) table);
      tte.setColumnIndex(columnUI.index);
      tte.setEvent(e.getEvent());
      be = tte;
    } else {
      TableEvent ce = new TableEvent((Table) table);
      ce.setColumnIndex(columnUI.index);
      ce.setEvent(e.getEvent());
      be = ce;
    }

    if (!((Component) table).fireEvent(Events.ColumnClick, be)) {
      return;
View Full Code Here

    columns.setSubMenu(columnMenu);
    menu.add(columns);

    if (table instanceof Table) {
      TableEvent e = new TableEvent((Table) table);
      e.setColumnIndex(column.getIndex());
      e.setMenu(menu);
      ((Table) table).fireEvent(Events.HeaderContextMenu, e);
    }

    return menu;
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.event.TableEvent

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.