Updated Branches:
  refs/heads/4.2 10c550e8c -> c657243f1

CLOUDSTACK-4092: UI > listView widget: fix a bug that a grid row was 
incorrectly removed when a non-add action of listView failed.


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

Branch: refs/heads/4.2
Commit: c657243f111ec2c5dddef1565fd7edf0e81d90ea
Parents: 10c550e
Author: Jessica Wang <jessicaw...@apache.org>
Authored: Wed Aug 7 11:06:04 2013 -0700
Committer: Jessica Wang <jessicaw...@apache.org>
Committed: Wed Aug 7 11:08:54 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c657243f/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js 
b/ui/scripts/ui/widgets/listView.js
index 6b44d99..0745c41 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -20,7 +20,9 @@
 (function($, cloudStack, _l, _s) {
     var uiActions = {
         standard: function($instanceRow, args, additional) {
-            var listViewArgs = 
$instanceRow.closest('div.list-view').data('view-args');
+               var isAddAction = args.action.isAdd;
+                               
+               var listViewArgs = 
$instanceRow.closest('div.list-view').data('view-args');
             var notification = args.action.notification ? 
args.action.notification : {};
             var messages = args.action ? args.action.messages : {};
             var preAction = args.action ? args.action.preAction : {};
@@ -254,7 +256,7 @@
 
                                     function(errorArgs) {
                                         if (!isHeader) {
-                                            if 
($instanceRow.data('list-view-new-item')) {
+                                            if (isAddAction == true && 
$instanceRow.data('list-view-new-item')) {
                                                 // For create forms
                                                 $instanceRow.remove();
                                             } else {
@@ -702,7 +704,7 @@
 
         // Actions column
         var actionsArray = actions ? $.map(actions, function(v, k) {
-            if (k == 'add') {
+            if (k == 'add' || k == 'rootAdminAddGuestNetwork') {
                 v.isAdd = true;
             }
 

Reply via email to