/** * Focus the cell and scrolls into view. * * @param rowIndex the row index * @param colIndex the column index * @param hscroll true to scroll horizontally */ public void focusCell(int rowIndex, int colIndex, boolean hscroll) { Point xy = ensureVisible(rowIndex, colIndex, hscroll); if (xy != null) { focusEl.setXY(xy); if (focusEnabled) { focusGrid(); } } }
protected void ensureVisible(CellEditor editor) { if (isVisible()) { grid.getView().ensureVisible(this.rowIndex, indexOf(editor), true); } }
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); } } }