Reputation: 5024
I have a button to add row into my grid and I want to start editing right after it was added, but I only managed how to select it. That's button's onclick:
addRegularPayment: function(button) {
var rec = new ETaxi.settings.model.MyModel();
var store = this.getMyModelStore();
var grid = this.getMyGrid();
store.insert(0, rec);
grid.getSelectionModel().select(rec);
//What I'm suppose to do?
}
Thank you in advance.
Upvotes: 0
Views: 3911
Reputation: 4047
Use the startEdit function from the grid's editing plugin:
grid.editingPlugin.startEdit(rec, 0);
The second parameter is the column to be edited, if you're using row editing you can omit it.
Also I'm pretty sure that start editing includes selecting the record, so it might be possible to omit the selection part in your code.
Upvotes: 4