com.extjs.gxt.ui.client.widget.grid.Grid.fireEvent()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(198)

本文整理了Java中com.extjs.gxt.ui.client.widget.grid.Grid.fireEvent()方法的一些代码示例,展示了Grid.fireEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grid.fireEvent()方法的具体详情如下:
包路径:com.extjs.gxt.ui.client.widget.grid.Grid
类名称:Grid
方法名:fireEvent

Grid.fireEvent介绍

暂无

代码示例

代码示例来源:origin: com.extjs/gxt

protected void onClick(GridEvent<M> e) {
 if (e.getRowIndex() != -1) {
  fireEvent(Events.RowClick, e);
  if (e.getColIndex() != -1) {
   fireEvent(Events.CellClick, e);
  }
 }
}

代码示例来源:origin: com.extjs/gxt

protected void onMouseUp(GridEvent<M> e) {
 if (e.getRowIndex() != -1) {
  fireEvent(Events.RowMouseUp, e);
  if (e.getColIndex() != -1) {
   fireEvent(Events.CellMouseUp, e);
  }
 }
}

代码示例来源:origin: com.extjs/gxt

protected void onDoubleClick(GridEvent<M> e) {
 if (e.getRowIndex() != -1) {
  fireEvent(Events.RowDoubleClick, e);
  if (e.getColIndex() != -1) {
   fireEvent(Events.CellDoubleClick, e);
  }
 }
}

代码示例来源:origin: com.extjs/gxt

public boolean onDoubleClick(GridEvent<M> e) {
 if (clicksToEdit == ClicksToEdit.TWO) {
  if (e.getRowIndex() != -1) {
   grid.fireEvent(Events.RowDoubleClick, e);
   if (e.getColIndex() != -1) {
    grid.fireEvent(Events.CellDoubleClick, e);
   }
  }
  return true;
 }
 return false;
}

代码示例来源:origin: com.extjs/gxt

protected void afterRenderView() {
 viewReady = true;
 view.afterRender();
 onAfterRenderView();
 for (String key : states.keySet()) {
  setAriaState(key, states.get(key));
 }
 fireEvent(Events.ViewReady);
}

代码示例来源:origin: com.extjs/gxt

protected void onMouseDown(GridEvent<M> e) {
 if (isDisableTextSelection() && GXT.isWebKit) {
  String tagName = e.getEvent().getEventTarget().<Element> cast().getTagName();
  if (!"input".equalsIgnoreCase(tagName) && !"textarea".equalsIgnoreCase(tagName)) {
   e.preventDefault();
  }
 }
 if (e.getRowIndex() != -1) {
  fireEvent(Events.RowMouseDown, e);
  if (e.getColIndex() != -1) {
   fireEvent(Events.CellMouseDown, e);
  }
 }
}

代码示例来源:origin: com.extjs/gxt

protected void onClick(GridEvent<ModelData> ce) {
 Element row = findRow(ce.getTarget());
 if (row != null) {
  ce.setRowIndex(findRowIndex(row));
  grid.fireEvent(Events.RowClick, ce);
 }
}

代码示例来源:origin: com.extjs/gxt

@SuppressWarnings("unchecked")
protected void onColumnSplitterMoved(int colIndex, int width) {
 stopEditing();
 userResized = true;
 width = Math.max(grid.getMinColumnWidth(), width);
 cm.setColumnWidth(colIndex, width);
 GridEvent<ModelData> e = (GridEvent<ModelData>) createComponentEvent(null);
 e.setColIndex(colIndex);
 e.setWidth(width);
 grid.fireEvent(Events.ColumnResize, e);
}

代码示例来源:origin: com.extjs/gxt

@SuppressWarnings("unchecked")
protected void syncScroll() {
 syncHeaderScroll();
 int scrollLeft = scroller.getScrollLeft();
 int scrollTop = scroller.getScrollTop();
 GridEvent<ModelData> ge = (GridEvent<ModelData>) createComponentEvent(null);
 ge.setScrollLeft(scrollLeft);
 ge.setScrollTop(scrollTop);
 constrainFocusElement();
 grid.fireEvent(Events.BodyScroll, ge);
}

代码示例来源:origin: com.extjs/gxt

/**
 * Reconfigures the grid to use a different Store and Column Model. The View
 * will be bound to the new objects and refreshed.
 * 
 * @param store the new store
 * @param cm the new column model
 */
public void reconfigure(ListStore<M> store, ColumnModel cm) {
 if (loadMask && rendered) {
  mask(GXT.MESSAGES.loadMask_msg());
 }
 if (rendered) {
  view.initData(store, cm);
 }
 this.store = store;
 this.cm = cm;
 // rebind the sm
 setSelectionModel(sm);
 if (isViewReady()) {
  view.refresh(true);
 }
 if (loadMask && rendered) {
  unmask();
 }
 fireEvent(Events.Reconfigure);
}

代码示例来源:origin: bedatadriven/activityinfo

@Override
protected void onRowOver(Element row) {
  int index = findRowIndex(row);
  if (index != -1) {
    ModelData model = grid.getStore().getAt(index);
    if (isHighlightable(model)) {
      fly(row).addStyleName(IndicatorLinkResources.INSTANCE.style().highlight());
      GridEvent event = new GridEvent(grid);
      event.setModel(model);
      grid.fireEvent(HighlightingGridView.ROW_MOUSE_OVER, event);
    }
  }
  overRow = row;
}

代码示例来源:origin: com.extjs/gxt

@SuppressWarnings("unchecked")
protected void updateHeaderSortState() {
 SortInfo state = getSortState();
 if (state == null || Util.isEmptyString(state.getSortField())) {
  return;
 }
 if (sortState == null || (!sortState.getSortField().equals(state.getSortField()))
   || sortState.getSortDir() != state.getSortDir()) {
  GridEvent<ModelData> e = (GridEvent<ModelData>) createComponentEvent(null);
  e.setSortInfo(state);
  sortState = new SortInfo(state.getSortField(), state.getSortDir());
  int sortColumn = cm.findColumnIndex(state.getSortField());
  if (sortColumn != -1) {
   updateSortIcon(sortColumn, sortState.getSortDir());
  }
  if (grid.isStateful()) {
   Map<String, Object> st = grid.getState();
   st.put("sortField", sortState.getSortField());
   st.put("sortDir", sortState.getSortDir().toString());
   grid.saveState();
  }
  grid.fireEvent(Events.SortChange, e);
 }
}

代码示例来源:origin: com.extjs/gxt

protected void onEditComplete(CellEditor ed, Object value, Object startValue) {
 editing = false;
 activeEditor = null;
 ed.removeListener(Events.SpecialKey, editorListener);
 ed.removeListener(Events.Complete, editorListener);
 ed.removeListener(Events.CancelEdit, editorListener);
 Record r = activeRecord;
 activeRecord = null;
 String field = cm.getDataIndex(ed.col);
 GridEvent<M> ge = new GridEvent<M>(grid);
 ge.setRecord(r);
 ge.setProperty(field);
 ge.setValue(value);
 ge.setStartValue(startValue);
 ge.setRowIndex(ed.row);
 ge.setColIndex(ed.col);
 if (grid.fireEvent(Events.ValidateEdit, ge)) {
  r.setValid(ge.getProperty(), ed.getField().isValid(true));
  r.set(ge.getProperty(), ge.getValue());
  grid.fireEvent(Events.AfterEdit, ge);
 }
 grid.getView().focusCell(ed.row, ed.col, false);
}

代码示例来源:origin: com.extjs/gxt

public void startEditing(final int row, final int col) {
 stopEditing();
 if (cm.isCellEditable(col)) {
  final M m = store.getAt(row);
  final String field = cm.getDataIndex(col);
  GridEvent<M> e = new GridEvent<M>(grid);
  e.setModel(m);
  e.setRecord(store.getRecord(m));
  e.setProperty(field);
  e.setRowIndex(row);
  e.setColIndex(col);
  e.setValue(m.get(field));
  if (grid.fireEvent(Events.BeforeEdit, e)) {
   ignoreScroll = true;
   grid.getView().ensureVisible(row, col, false);
   // required because of triggerfields
   startEditTimer = new Timer() {
    @Override
    public void run() {
     startEditTimer = null;
     deferStartEditing(m, field, row, col);
    }
   };
   startEditTimer.schedule(10);
  }
 }
}

相关文章