Start editing in a specific cell in an ExtJs 3.4 grid

user618505 picture user618505 · Feb 24, 2012 · Viewed 7.6k times · Source

In my grid I have added a row editor as plugin (with new Ext.ux.grid.RowEditor()). I want to set focus on a specific column in a specific record.

This is what I have now: editor.startEditing(record);;

It starts editing and sets focus on the first field, but I want to define a different field. Searching the web I see people having something like: editor.startEditing(record, column) or editor.startEdit(record, column) the first doesn't seem to work and the latter function does not exist.

The solution could rely in a 'RowEditing' plugin but since ExtJs is new to me I don't understand how to do that.

Any help is very much appreciated.

Answer

dbrin picture dbrin · Feb 25, 2012

I am using a grid with a Row Editor in ExtJS 4.0.2 and I programatically add a row and start editing it with this code:

var editor = grid.getPlugin('myRowEditor');
grid.getSelectionModel().select(lastRowCounter);   //0 based selector.
editor.startEdit(lastRowCounter,1);  //start editing on Second column.