PDA

View Full Version : [CLOSED] Grid Focus on next Row same column editor cell



registrator
Jun 11, 2015, 10:42 AM
On button click I am entering a value in the grid cell. When this is done I would like to move the focus to the next row, same column, cell so I can do another button click and enter another automatic cell value.
How can this be done please?

Thank you

Daniil
Jun 11, 2015, 9:29 PM
Hi @registrator,

You can start editing of cell using an editing plugin's startEdit method.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.plugin.CellEditing-method-startEdit

registrator
Jun 11, 2015, 10:01 PM
Hi Daniil

I have tried with this function and I get stopEditing is not a function!


var grid = App.GridPanelCR;
var record = grid.getSelectionModel().getSelection()[0];
var netvalue = record.get("NET");
record.set("PAID", toFixed(netvalue, 2));
grid.stopEditing();
var index = grid.store.indexOf(record);
grid.getSelectionModel().selectRow(index + 1);
grid.startEditing(index + 1, 12);

thank you

Daniil
Jun 12, 2015, 10:50 AM
I don't see the
.stopEditing() function in ExtJS API.
http://docs.sencha.com/extjs/4.2.1

But I see the .completeEdit() one on editing plugin.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.plugin.CellEditing-method-completeEdit

registrator
Jun 12, 2015, 11:01 AM
I have changed it to this:


ar grid = App.GridPanelCR;
var record = grid.getSelectionModel().getSelection()[0];
var netvalue = record.get("NET");
record.set("PAID", toFixed(netvalue, 2));
grid.completeEdit;
var index = grid.store.indexOf(record);

grid.startEditing(index + 1, 12);
doCustomerReceiptRowCalculations(null, null);

So completeEdit without the "()" as completeEdit() was giving the same error: not a function.

Now this code gives again not a function but for grid.startEditing

It's very confusing.

Daniil
Jun 15, 2015, 2:15 PM
There is no .completeEdit() on a GridPanel. This methods belongs to an editing plugin.