incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: cloudstack UI - listView widget - keep advanced search criteria when scrolling down grid when the last search is from advanced search dialog.
Date Thu, 04 Oct 2012 23:30:32 GMT
Updated Branches:
  refs/heads/master a2a1e19e7 -> a5c9c560f


cloudstack UI - listView widget - keep advanced search criteria when scrolling down grid when
the last search is from advanced search dialog.


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

Branch: refs/heads/master
Commit: a5c9c560ffca028fd3fe6576091e5196a91a67a0
Parents: a2a1e19
Author: Jessica Wang <jessica.wang@citrix.com>
Authored: Thu Oct 4 16:29:10 2012 -0700
Committer: Jessica Wang <jessica.wang@citrix.com>
Committed: Thu Oct 4 16:30:17 2012 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a5c9c560/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index d341d55..a6d2113 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -1325,7 +1325,9 @@
     });
 
 		//basic search
-    var basicSearch = function() {
+    var basicSearch = function() {		 
+			$listView.removeData('advSearch');
+		
       page = 1;
       loadBody(
         $table,
@@ -1375,7 +1377,9 @@
     });
    		
 		//advanced search 	
-		var advancedSearch = function(args) {		  
+		var advancedSearch = function(args) {		     
+			$listView.data('advSearch', args.data);
+				
       page = 1;			
       loadBody(
         $table,
@@ -1425,17 +1429,24 @@
 
         if (loadMoreData) {
           page = page + 1;
-
+					
+					var filterBy = {
+					  kind: $listView.find('select[id=filterBy]').length > 0? $listView.find('select[id=filterBy]').val():
'all'
+					};				
+					if($listView.data('advSearch') == null) {
+					  filterBy.search = {
+							value: $listView.find('input[type=text]').length > 0? $listView.find('input[type=text]').val():
'',
+							by: 'name'
+						};
+					}
+					else {
+					  filterBy.advSearch = $listView.data('advSearch');
+					}
+					
           loadBody($table, listViewData.dataProvider, listViewData.preFilter, listViewData.fields,
true, {
             context: context,
             page: page,
-            filterBy: {	
-							kind: $listView.find('select[id=filterBy]').length > 0? $listView.find('select[id=filterBy]').val():
'all',
-							search: {
-								value: $listView.find('input[type=text]').length > 0? $listView.find('input[type=text]').val():
'',
-								by: 'name'
-							}
-            }
+            filterBy: filterBy
           }, actions, {
             reorder: listViewData.reorder
           });


Mime
View raw message