somedude
somedude

Reputation: 179

How to cancel jqGrid cell edit operation

I need to be able to cancel Cell Edit operation based on certain condition. I am using beforeSaveCell event to achieve this. I can change the value the cell but cannot reject the newly entered value and keep the old value. Please help me...

beforeSaveCell: function (rowid, celname, value, iRow, iCol) {
     if(some_condition)
         return value;
     else
         //cancel the edit operation, how?
}

Thank you

Upvotes: 2

Views: 945

Answers (1)

Oleg
Oleg

Reputation: 221997

It looks like that you make some kind of validation of the saved value. Probably you should use custom_func together with custom: true property in editrules?

Upvotes: 1

Related Questions