PDA

View Full Version : grid record not getting committed on click of button



rishisaraf11
30 Jan 2012, 7:55 AM
Hello Folks,

I am facing very strange issue of grid editing in IE. I have a grid and to save that grid I have save button outside the grid. Now suppose I edit any cell inside the grid and without clicking anywhere else I click on save button , change don't get commited and because of that when I say store.getUpdatedRecords() I don't get any record.

Attach is screen shot where I have edited the Telephone area code(last column of Site Information tab) , now suppose I click on save , store.getUpdatedRecords() dont give any record. However if suppose I click somewhere else in screen and then click on save I get modified record.

31148
Regards
Rishi Saraf

Farish
30 Jan 2012, 8:25 AM
its because the record is not changed in the store until you press the Update button of the roweditor. if you are still in editing mode, the value is still the old one in the store and so getUpdatedRecords() will not find this change.

rishisaraf11
30 Jan 2012, 8:35 PM
Hi Farish

Do you have any idea which event I can fire to update the record.

Regards
Rishi Saraf

Farish
31 Jan 2012, 12:09 AM
On press of your Save button, you can call the completeEdit() method of the RowEditing plugin and then use store.getUpdatedRecords():

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.RowEditing-method-completeEdit

rishisaraf11
31 Jan 2012, 3:30 AM
Complete edit is RowEditor event however I am using CellEditing plugin. So I want similar event for cell editor.

Regards
Rishi Saraf

On press of your Save button, you can call the completeEdit() method of the RowEditing plugin and then use store.getUpdatedRecords():

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.RowEditing-method-completeEdit (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.grid.plugin.RowEditing-method-completeEdit)

Farish
31 Jan 2012, 3:36 AM
There is also a completeEdit() method for cellEditing plugin.

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.plugin.CellEditing-method-completeEdit (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.grid.plugin.CellEditing-method-completeEdit)

Its a method not an event. You can just call this method on the Save button handler.

PravinKumar
6 Oct 2014, 10:49 AM
I'm facing this same issue in EditorGridPanel And completeEdit() is not working there. Could you tell me how to resolve this. I'm using Extjs 3.2.1

PravinKumar
6 Oct 2014, 11:10 AM
I'm facing this same issue in EditorGridPanel And completeEdit() is not working there. Could you tell me how to resolve this. I'm using Extjs 3.2.1
I'm able to fix this by code

grid.activeEditor.completeEdit();