You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2013/04/09 23:42:36 UTC

[48/50] [abbrv] git commit: updated refs/heads/vmsync to 2ee8fd2

multiEdit: Support createForm for actions

If 'createForm' block is specified in a multi-edit action, show
createForm and pass fields to action.


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

Branch: refs/heads/vmsync
Commit: 6a1d38476101429ad149617b684a31f80afcc0f7
Parents: 1a5162f
Author: Brian Federle <br...@citrix.com>
Authored: Mon Apr 8 17:14:03 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Tue Apr 9 12:50:08 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/multiEdit.js |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a1d3847/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 0a05591..2cb04147 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -323,6 +323,7 @@
               var $expandable = $dataItem.find('.expandable-listing');
               var isDestroy = $target.hasClass('destroy');
               var isEdit = $target.hasClass('edit');
+              var createForm = action.createForm;
 
               if (isDestroy) {
                 var $loading = _medit.loadingItem($multi, _l('label.removing') + '...');
@@ -340,7 +341,19 @@
               }
 
               if (!isEdit) {
-                performAction();
+                if (createForm) {
+                  cloudStack.dialog.createForm({
+                    form: createForm,
+                    after: function(args) {
+                      var $loading = $('<div>').addClass('loading-overlay').prependTo($dataItem);
+                      performAction({ data: args.data, complete: function() {
+                        $multi.trigger('refresh');
+                      } });
+                    }
+                  });
+                } else {
+                  performAction();
+                }
               } else {
                 // Get editable fields
                 var editableFields = {};