UI create form: Support custom checkbox 'on change' event

If field is a checkbox (isBoolean: true) and onChange function is
specified, then call this onChange everytime checkbox is clicked.
This commit is contained in:
Brian Federle 2012-08-23 10:55:21 -07:00
parent b5d00724fa
commit 7e3b4408cb

View File

@ -273,6 +273,15 @@
}, 100);
}
}
// Setup on click event
if (field.onChange) {
$input.click(function() {
field.onChange({
$checkbox: $input
});
});
}
} else if (field.dynamic) {
// Generate a 'sub-create-form' -- append resulting fields
$input = $('<div>').addClass('dynamic-input').appendTo($value);