CLOUDSTACK-4925: UI > dialog widget > extend isChecked property to take function type (it takes only boolean type before this check-in).

This commit is contained in:
Jessica Wang 2013-10-22 11:19:23 -07:00
parent 3b28f73bea
commit 5ca5cb1903
1 changed files with 11 additions and 5 deletions

View File

@ -368,11 +368,17 @@
});
} else {
$input = $('<input>').attr({
name: key,
type: 'checkbox'
}).appendTo($value);
if (field.isChecked) {
$input = $('<input>').attr({
name: key,
type: 'checkbox'
}).appendTo($value);
var isChecked;
if (typeof (field.isChecked) == 'function') {
isChecked = field.isChecked();
} else {
isChecked = field.isChecked;
}
if (isChecked) {
$input.attr('checked', 'checked');
} else {
// This is mainly for IE compatibility