PDA

View Full Version : Grid ComponentColumns, How To Focus Component ?



Jinan
27 Dec 2013, 12:48 AM
I have a grid with component columns, and I need to focus the first component cell to start edit, so how to focus the TextTield for example in the Component Column
All I can get is:
grid.getSelectionModel().setCurrentPosition({ row: 0, column: 0 });
and it's select the cell not the component ?

scottmartin
27 Dec 2013, 3:21 PM
Have a look at:


var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});

..

cellEditing.startEditByPosition({row: 0, column: 0})

Jinan
29 Dec 2013, 11:05 PM
Thank u, but the grid without editing plugin, only Component Columns, actually I found solution like this:


grid.getView().focusCell({ row: 0, column: 0 });

if doesn't work with you, try to set time out:

setTimeout(function () {
grid.getView().focusCell({ row: 0, column: 0 });
}, 100);

or maybe set delay for event which call this instruction, hope it helps