mirror of https://github.com/apache/cloudstack.git
multiEdit: support validate on custom action
If requireValidation: true is set for a custom action, then only
perform action if multiEdit's form fields are valid. This does not
apply to clicking on existing rules' action buttons.
Syntax:
multiEdit: {
fields: {
testField: {
custom: {
requireValidation: true,
...
},
...
},
...
}
}
This commit is contained in:
parent
fa2d392ba2
commit
365e8803cd
|
|
@ -804,6 +804,9 @@
|
|||
$('<div>').addClass('button add-vm custom-action')
|
||||
.html(_l(field.custom.buttonLabel))
|
||||
.click(function() {
|
||||
if (field.custom.requireValidation &&
|
||||
!$multiForm.valid()) return false;
|
||||
|
||||
var formData = getMultiData($multi);
|
||||
|
||||
field.custom.action({
|
||||
|
|
@ -816,6 +819,8 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}).appendTo($td);
|
||||
} else if (field.addButton) {
|
||||
$addVM = $('<div>').addClass('button add-vm').html(
|
||||
|
|
|
|||
Loading…
Reference in New Issue