From 5ca5cb1903b5904f8fed18108bfab8b9c7bee863 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 22 Oct 2013 11:19:23 -0700 Subject: [PATCH] CLOUDSTACK-4925: UI > dialog widget > extend isChecked property to take function type (it takes only boolean type before this check-in). --- ui/scripts/ui/dialog.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 4bbaf9c388f..ff6086551f8 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -368,11 +368,17 @@ }); } else { - $input = $('').attr({ - name: key, - type: 'checkbox' - }).appendTo($value); - if (field.isChecked) { + $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