PDA

View Full Version : EditorGridPanel save when cell is updated (loses focus?)



dobberph
7 Mar 2010, 6:38 AM
Hi all,

I found some code for this, but not exactly.

I want to save every single record in the moment it was edited (I think this must be when the cell loses focus?).
I have two problems:
1. where and how do I have to set up the eventlistener
2. If you have a solution for me with Ajax.request: How does a .php-script would look like that only echos the provided data?

Thanks for the newbie help and best regards,
Tobias

dobberph
8 Mar 2010, 2:23 AM
For the first problem I found a solution for myself:



grid.addListener(
'afteredit',
function(e) {
var oldVal = e.originalValue;
var newVal = e.value;
var fieldName = e.field;
var record = e.record;
alert('Field \'' + fieldName + '\' changed from \'' + oldVal + '\' to \'' + newVal + '\'. (id: ' + e.record.data.id + ')');
}
);

But I still don't know how to send this data to a php-file and how to receive the data at the php-file properly.

Thanks a lot,
Tobias