cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [10/17] git commit: Multi-edit: refactor form serialization
Date Wed, 11 Jul 2012 20:18:07 GMT
Multi-edit: refactor form serialization

To support header-level form items, serialize every form within the
multi-edit div (not just the main table form). For reusability, make
data serialization handled in separate 'getMultiData' function.


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

Branch: refs/heads/vpc
Commit: 04ac28202fdec381ec8284c7d49c55edea39ad5f
Parents: 7de02b6
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Jul 10 14:01:38 2012 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Jul 10 14:57:06 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/04ac2820/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 8eac506..e5278db 100644
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -15,6 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 (function($, cloudStack) {
+  var getMultiData = function($multi) {
+    return cloudStack.serializeForm($multi.find('form'));
+  };
+
   var _medit = cloudStack.ui.widgets.multiEdit = {
     /**
      * Append item to list
@@ -790,7 +794,7 @@
       var addItem = function(itemData) {
         var data = {};
 
-        $.each(cloudStack.serializeForm($multiForm), function(key, value) {
+        $.each(getMultiData($multi), function(key, value) {
           if (value != '') {
             data[key] = value;
           }


Mime
View raw message