I have a grid bound to a datasource with 10 fields, all of which are checkboxes. The grid has popup editing enabled.
I want to add a validation that checks (before submit) that atleast one checkbox is checked. How can I add this validation?
All the examples show validation that is per field, whereas I want a validation for the entire row.
UPDATE SaveChanges did not work for me but save did.
save:function(e) {
if(e.model){
var selected = false;
for (var key in e.model) {
if (e.model.hasOwnProperty(key)) {
if(typeof e.model[key] == "boolean"){
if(e.model[key]){
selected = true;
break;
}
}
}
}
if(!selected){
e.preventDefault();
}
}