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 b04b6a0fbe
commit 5795664bd2
1 changed files with 8 additions and 2 deletions

View File

@ -376,8 +376,14 @@
name: key,
type: 'checkbox'
}).appendTo($value);
if (field.isChecked) {
$input.attr('checked', strOrFunc(field.isChecked));
var isChecked;
if (typeof (field.isChecked) == 'function') {
isChecked = field.isChecked();
} else {
isChecked = field.isChecked;
}
if (isChecked) {
$input.attr('checked', strOrFunc(field.isChecked));
} else {
// This is mainly for IE compatibility
setTimeout(function() {