PDA

View Full Version : Editing and saving an editor grid cell from a context menu



Yemi
27 Aug 2013, 9:02 AM
Hello,
I have a context menu on a grid and am trying to edit a cell on clicking edit on the context menu, how do I achieve this? also when I click on enter, the new record should be saved automatically, How can I achieve this, especially the latter. Sample code will be appreciated.

Yemi
28 Aug 2013, 4:11 AM
Any ideas please ?

willigogs
28 Aug 2013, 12:50 PM
Use the cellContextMenu event:
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.EditorGridPanel-event-cellcontextmenu

U (http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.EditorGridPanel-event-cellcontextmenu)se the provided columnIndex and RowIndex values to call the startEditing method:
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.EditorGridPanel-method-startEditing

I (http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.EditorGridPanel-method-startEditing)f your grid's store has autoSave set to true, then any modifications will automatically be sent to the server:
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.data.Store-cfg-autoSave