May 10, 2011, 9:19 AM
[CLOSED] Insert Grid Record - Edit First Cell?
I've seen posts like http://forums.ext.net/showthread.php...cord-gridpanel whereby the row is focussed, but is it possible to actually have the grid go into edit mode (ie: as though I'd double-clicked on the cell)? Or, is this what is meant to happen?
The code I've tried (in a function) is:
The code I've tried (in a function) is:
insertGridRecord: function (grid, record, defaultEditCol, showErrors) {
var count = grid.getStore().getTotalCount();
grid.insertRecord(count, (record != null) ? record : {}, false);
grid.startEditing(count + 1, defaultEditCol || 0);
grid.selModel.selectRow(0);
}
.. this does everything I expect, except the row never goes into edit mode; it is just highlighted. Am I doing something wrong? I'm calling the code thus:<ext:Button ID="btnNew" runat="server" Text="New" Icon="Add">
<Listeners>
<Click Handler="SaveAndInvest.insertGridRecord(#{gridChequeDiaries}, { ReconciledStatus:'Draft' }, 0);" />
</Listeners>
</ext:Button>
Many thanks.
Last edited by Daniil; May 17, 2011 at 1:59 PM.
Reason: [CLOSED]