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

What data is passed to saveChanges event?

2 Answers 179 Views
Grid
This is a migrated thread and some comments may be shown as answers.
M
Top achievements
Rank 1
M asked on 24 Oct 2012, 11:58 AM
I'm trying to intercept the adding/updating of records to a Grid.

It seems the saveChanges event is triggered at the appropriate time -- just before sending the data to the server, but how can I extract the data that's being saved/updated and how can I prevent the action if necessary?

Thanks

2 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 26 Oct 2012, 10:22 AM
Basic example but should be enough.

function saveChanges(e) {
    if (!IsValid($("#myForm"))) {
        e.preventDefault(); //Stops the AJAX request
    }
}


0
M
Top achievements
Rank 1
answered on 26 Oct 2012, 10:35 AM
Thanks for that.

I'll give it a try.
Tags
Grid
Asked by
M
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
M
Top achievements
Rank 1
Share this question
or