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

Problems with grid saveChanges event

2 Answers 228 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 29 Oct 2012, 01:30 PM
I'm intending to use the Grid's saveChanges event to perform some custom validation and prevent the record being saved if necessary.

I've had a look through these forums and it seems I should be able to prevent the save using:
   saveChanges: function(e) { 
e.preventDefault();
   }

This isn't working. All records are being saved.

Can somebody please explain what the saveChanges event is for, when it is called and how it should be used. The documentation is very sparse.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Scott Marx
Top achievements
Rank 1
answered on 04 Oct 2013, 05:18 PM
Did you ever get an answer?
0
Scott Marx
Top achievements
Rank 1
answered on 04 Oct 2013, 06:44 PM
I found the solution. The saveChanges: must be after the tool:

toolbar: ["create", "save", "cancel"],
saveChanges: function (e) {
handleSaveChanges(e, this);
},
Tags
Grid
Asked by
M
Top achievements
Rank 1
Answers by
Scott Marx
Top achievements
Rank 1
Share this question
or