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

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

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

Grid.getView介绍

[英]Returns the grid's view.
[中]返回网格的视图。

代码示例

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

  1. @Override
  2. protected void onRowUpdated(GridEvent<M> ge) {
  3. if (selection != null && selection.model == ge.getModel()) {
  4. grid.getView().onCellSelect(selection.row, selection.cell);
  5. grid.getView().focusCell(selection.row, selection.cell, true);
  6. }
  7. }

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

  1. /**
  2. * Returns the column index.
  3. *
  4. * @return the column index
  5. */
  6. public int getColIndex() {
  7. if (colIndex == -1) {
  8. colIndex = grid.getView().findCellIndex(getTarget(), null);
  9. }
  10. return colIndex;
  11. }

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

  1. /**
  2. * Returns the row index.
  3. *
  4. * @return the row index
  5. */
  6. public int getRowIndex() {
  7. if (rowIndex == -1) {
  8. rowIndex = grid.getView().findRowIndex(getTarget());
  9. }
  10. return rowIndex;
  11. }

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

  1. public int getPageSize() {
  2. if (pageSize == -1) {
  3. pageSize = ((LiveGridView) getGrid().getView()).getVisibleRowCount();
  4. }
  5. return pageSize;
  6. }

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

  1. protected void handleColumnHidden(ColumnModelEvent e) {
  2. ColumnHeader header = grid.getView().getHeader();
  3. if (header != null) {
  4. int col = e.getColIndex();
  5. Head h = header.getHead(col);
  6. if (h == selectedHeader) {
  7. selectedHeader = null;
  8. }
  9. }
  10. }

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

  1. protected void ensureVisible(CellEditor editor) {
  2. if (isVisible()) {
  3. grid.getView().ensureVisible(this.rowIndex, indexOf(editor), true);
  4. }
  5. }

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

  1. @Override
  2. public void deselectAll() {
  3. if (selection != null) {
  4. // index may change with tree grid on expand / collapse
  5. // ask store for current row index
  6. int row = listStore.indexOf(selection.model);
  7. if (grid.isViewReady()) {
  8. grid.getView().onCellDeselect(row, selection.cell);
  9. }
  10. selection = null;
  11. }
  12. }

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

  1. protected void onAutoEditClick(GridEvent<M> e) {
  2. if (e.getEvent().getButton() != Event.BUTTON_LEFT) {
  3. return;
  4. }
  5. int row = grid.getView().findRowIndex(e.getTarget());
  6. int cell = grid.getView().findRowIndex(e.getTarget());
  7. if (row != -1 && cell != -1) {
  8. stopEditing();
  9. }
  10. }

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

  1. /**
  2. * Collapses the given row.
  3. *
  4. * @param rowIndex the rowIndex
  5. */
  6. public void collapseRow(int rowIndex) {
  7. El row = new El((Element)grid.getView().getRow(rowIndex));
  8. if (row != null && isExpanded(row)) {
  9. collapseRow(row);
  10. }
  11. }

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

  1. /**
  2. * Expands the given row.
  3. *
  4. * @param rowIndex the row index
  5. */
  6. public void expandRow(int rowIndex) {
  7. El row = new El((Element)grid.getView().getRow(rowIndex));
  8. if (row != null && !isExpanded(row)) {
  9. expandRow(row);
  10. }
  11. }

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

  1. private void setChecked(boolean checked) {
  2. if (grid.isViewReady()) {
  3. El hd = grid.getView().innerHd.child("div.x-grid3-hd-checker");
  4. if (hd != null) {
  5. hd.getParent().setStyleName("x-grid3-hd-checker-on", checked);
  6. }
  7. }
  8. }

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

  1. /**
  2. * Selects the next row.
  3. *
  4. * @param keepexisting true to keep existing selections
  5. */
  6. public void selectNext(boolean keepexisting) {
  7. if (hasNext()) {
  8. int idx = listStore.indexOf(lastSelected) + 1;
  9. select(idx, keepexisting);
  10. grid.getView().focusRow(idx);
  11. }
  12. }

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

  1. /**
  2. * Selects the previous row.
  3. *
  4. * @param keepexisting true to keep existing selections
  5. */
  6. public void selectPrevious(boolean keepexisting) {
  7. if (hasPrevious()) {
  8. int idx = listStore.indexOf(lastSelected) - 1;
  9. select(idx, keepexisting);
  10. grid.getView().focusRow(idx);
  11. }
  12. }

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

  1. protected void onHide() {
  2. super.onHide();
  3. stopMonitoring();
  4. grid.getView().focusRow(rowIndex);
  5. record = null;
  6. ComponentHelper.doDetach(this);
  7. }

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

  1. protected void toggleRow(El row) {
  2. if (row.hasStyleName("x-grid3-row-collapsed")) {
  3. expandRow(row);
  4. } else {
  5. collapseRow(row);
  6. }
  7. grid.getView().calculateVBar(false);
  8. }

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

  1. protected void onEditCancel(CellEditor ed, Object value, Object startValue) {
  2. editing = false;
  3. activeEditor = null;
  4. activeRecord = null;
  5. ed.removeListener(Events.SpecialKey, editorListener);
  6. ed.removeListener(Events.Complete, editorListener);
  7. ed.removeListener(Events.CancelEdit, editorListener);
  8. grid.getView().focusCell(ed.row, ed.col, false);
  9. }

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

  1. public int getRowY(IndicatorDTO indicator) {
  2. int rowIndex = grid.getStore().indexOf(indicator);
  3. if (rowIndex == -1) {
  4. throw new IllegalArgumentException("indicatorId=" + indicator.getId());
  5. }
  6. Element row = grid.getView().getRow(rowIndex);
  7. Point p = El.fly(row).getAnchorXY("c", false);
  8. return p.y;
  9. }

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

  1. @Override
  2. protected void onDragMove(DNDEvent event) {
  3. if (!event.within(grid.getView().getBody().dom)) {
  4. event.setCancelled(true);
  5. event.getStatus().setStatus(false);
  6. return;
  7. }
  8. event.setCancelled(false);
  9. event.getStatus().setStatus(true);
  10. }

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

  1. protected int getTargetColumnIndex(Point pt) {
  2. for (int i = 0, j = 0; i < grid.getColumnModel().getColumnCount(); i++) {
  3. ColumnConfig c = grid.getColumnModel().getColumn(i);
  4. if (!c.isHidden()) {
  5. if (El.fly(grid.getView().getHeaderCell(i)).getRegion().right >= pt.x) {
  6. return j;
  7. }
  8. j++;
  9. }
  10. }
  11. return -1;
  12. }

代码示例来源:origin: geoserver/geofence

  1. public void handleEvent(GridEvent<RuleModel> be) {
  2. for (int i = 0; i < be.getGrid().getStore().getCount(); i++) {
  3. final Widget wid = be.getGrid().getView().getWidget(i, be.getColIndex());
  4. if ((wid != null) && (wid instanceof BoxComponent)) {
  5. ((BoxComponent) wid).setWidth(be.getWidth() - offset);
  6. }
  7. }
  8. }
  9. }

相关文章