cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [11/43] git commit: updated refs/heads/master to 5ce2890
Date Thu, 25 Apr 2013 18:08:29 GMT
List view UI: Support pre-selected checkboxes

In listings with checkbox actions, if _isSelected: true is passed in a
data item, then pre-select the checkbox on load.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a589a367
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a589a367
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a589a367

Branch: refs/heads/master
Commit: a589a367d07d01e22356d8eb123c9ed482e05c96
Parents: 66a16a1
Author: Brian Federle <brian.federle@citrix.com>
Authored: Mon Apr 15 14:02:42 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Mon Apr 15 14:02:42 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a589a367/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index c5e0561..4bd4a42 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -734,6 +734,8 @@
   var makeActionIcons = function($td, actions, options) {
     options = options ? options : {};
     var allowedActions = options.allowedActions;
+    var $tr = $td.closest('tr');
+    var data = $tr && $tr.data('json-obj') ? $tr.data('json-obj') : null;
 
     $.each(actions, function(actionName, action) {
       if (actionName == 'add' || action.isHeader)
@@ -766,7 +768,9 @@
             .append(
               $('<input>').attr({
                 type: 'checkbox',
-                name: actionName
+                name: actionName,
+                checked: data && data._isSelected ?
+                  'checked' : false
               })
             )
             .attr({


Mime
View raw message