Package com.sencha.gxt.widget.core.client.grid.Grid

Examples of com.sencha.gxt.widget.core.client.grid.Grid.GridCell


  }

  @Override
  public void cancelEditing() {
    if (activeCell != null) {
      final GridCell editCell = activeCell;
      removeEditor();
      fireEvent(new CancelEditEvent<M>(editCell));
    }
  }
View Full Code Here


      }
      for (int i = 0, len = columnModel.getColumnCount(); i < len; i++) {
        ColumnConfig<M, ?> c = columnModel.getColumn(i);
        doCompleteEditing(c);
      }
      final GridCell editCell = activeCell;
      removeEditor();
      fireEvent(new CompleteEditEvent<M>(editCell));
    }
  }
View Full Code Here

      Field<?> field = getEditor(c);
      field.clear();

      removeEditor(activeCell, field);

      final GridCell gc = activeCell;
      activeCell = null;

      fireEvent(new CancelEditEvent<M>(gc));

      if (focusOnComplete) {
View Full Code Here

    GridSelectionModel<M> sm = getEditableGrid().getSelectionModel();
    if (sm instanceof CellSelectionModel) {
      CellSelection<M> cell = ((CellSelectionModel<M>) sm).getSelectCell();
      if (cell != null) {
        evt.preventDefault();
        startEditing(new GridCell(cell.getRow(), cell.getCell()));
      }
    }
  }
View Full Code Here

    }

    // keep active cell since we manually fire blur (finishEditing) which will
    // call cancel edit
    // clearing active cell
    final GridCell active = activeCell;

    if (GXTLogConfiguration.loggingIsEnabled()) {
      logger.finest("onTab activeCell is " + (activeCell == null ? "null" : "not null"));
    }

    if (activeCell != null) {
      ColumnConfig<M, ?> c = columnModel.getColumn(activeCell.getCol());

      Field<?> field = getEditor(c);

      // we handle navigation programatically
      evt.preventDefault();

      // since we are preventingDefault on tab key, the field will not blur on
      // its
      // own, which means the value change event will not fire so we manually
      // blur
      // the field, so we call finishEditing
      if (GXTLogConfiguration.loggingIsEnabled()) {
        logger.finest("onTab calling field.finishEditing()");
      }
      field.finishEditing();

    }

    if (active != null) {

      GridCell newCell = null;

      if (evt.getShiftKey()) {
        newCell = getEditableGrid().walkCells(active.getRow(), active.getCol() - 1, -1, callback);
      } else {
        newCell = getEditableGrid().walkCells(active.getRow(), active.getCol() + 1, 1, callback);
      }
      if (newCell != null) {
        final GridCell c = newCell;

        Scheduler.get().scheduleFinally(new ScheduledCommand() {

          @Override
          public void execute() {
View Full Code Here

    if (editableGrid != null) {
      if (editableGrid.getView().isSelectableTarget(target) && editableGrid.getView().getBody().isOrHasChild(target)) {
        int row = editableGrid.getView().findRowIndex(target);
        int col = editableGrid.getView().findCellIndex(target, null);
        if (row != -1 && col != -1) {
          return new GridCell(row, col);
        }
      }
    }
    return null;
  }
View Full Code Here

    }
  }

  protected void onClick(final ClickEvent event) {
    if (clicksToEdit == ClicksToEdit.ONE) {
      final GridCell cell = findCell(event.getNativeEvent().getEventTarget().<Element> cast());
      if (cell == null) {
        return;
      }

      // EXTGWT-2019 when starting an edit on the same row of an active edit
      // the active edit value
      // is lost as the active cell does not complete the edit
      // this only happens with TreeGrid, not Grid which could be looked into
      if (activeCell != null && activeCell.getRow() == cell.getRow()) {
        completeEditing();
      }

      // EXTGWT-3334 Edit is starting and stopping immediately when leaving another active edit that completes
      Scheduler.get().scheduleDeferred(new ScheduledCommand() {
View Full Code Here

    }
  }

  protected void onEnter(NativeEvent evt) {
    evt.preventDefault();
    GridCell gc = activeCell;
    completeEditing();
    if (gc != null) {
      focusCell(gc.getRow(), gc.getCol());
    }
  }
View Full Code Here

      focusCell(gc.getRow(), gc.getCol());
    }
  }

  protected void onEsc(NativeEvent evt) {
    GridCell gc = activeCell;
    cancelEditing();
    if (gc != null) {
      focusCell(gc.getRow(), gc.getCol());
      focusGrid();
    }
  }
View Full Code Here

  }

  protected abstract void showTooltip(SafeHtml content);

  protected void startEditing(Element target) {
    GridCell cell = findCell(target);
    if (cell != null) {
      int row = cell.getRow();
      int col = cell.getCol();
      if (row != -1 && col != -1) {
        startEditing(new GridCell(row, col));
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.grid.Grid.GridCell

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.