This is a migrated thread and some comments may be shown as answers.

Save on cell changed

7 Answers 463 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 13 Jan 2012, 07:21 PM
Hi!
I want to edit several grid cell's, but i want to save in the remote database that change, when the edited cell lose it's focus.

Anyone has already faced the same problem?

7 Answers, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 1
answered on 14 Jan 2012, 09:13 PM
Carlos,

You can use the edit event of the grid to help you do this. I've built a sample jsFiddle here: http://jsfiddle.net/latenightcoder/6ZNqN/1/ 

On the blurring out of a cell, I log it's new value. You can then use that to make a jquery ajax call to a server-side save mechanism.

Joel
0
underscore
Top achievements
Rank 1
answered on 15 Jan 2012, 02:29 PM
Joel - your method works with strings only but not with numeric + boolean variables - do you agree?
0
Accepted
Joel
Top achievements
Rank 1
answered on 15 Jan 2012, 09:00 PM
Yeah, I had thrown that up in a couple of minutes. Here's an update that works with numeric and boolean: http://jsfiddle.net/latenightcoder/6ZNqN/6/

Might need some more tweaking but this should give you a general idea of how to handle the various input types.

Joel

0
underscore
Top achievements
Rank 1
answered on 15 Jan 2012, 11:07 PM
many thanks, get the idea. Still throws an error in my application but think that can be managed...
0
Carlos
Top achievements
Rank 1
answered on 17 Jan 2012, 11:04 AM
Thank you! That's one good way to do it! Now how can I get all the attributes from the row with the edited field, I need all of them to make the ajax call...

Thank you!!
0
Joel
Top achievements
Rank 1
answered on 18 Jan 2012, 06:06 AM
Glad to hear it helped!

If you get a chance, could you mark the response as the answer so that it helps other forum users. Thanks!

Joel
0
underscore
Top achievements
Rank 1
answered on 18 Jan 2012, 10:16 PM
sorry, another problem - with an empty numeric value the trigger will not work...
Tags
Grid
Asked by
Carlos
Top achievements
Rank 1
Answers by
Joel
Top achievements
Rank 1
underscore
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Share this question
or