You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/09/26 20:05:02 UTC
git commit: cloudstack UI - advanced search - extend listView widget
to pass data on Advanced Search Dialog to data provider.
Updated Branches:
refs/heads/master ef48250bd -> d09b46751
cloudstack UI - advanced search - extend listView widget to pass data on Advanced Search Dialog to data provider.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d09b4675
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d09b4675
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d09b4675
Branch: refs/heads/master
Commit: d09b46751c9058def37269a500ac417b71b50b21
Parents: ef48250
Author: Jessica Wang <je...@citrix.com>
Authored: Wed Sep 26 11:02:45 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Wed Sep 26 11:04:39 2012 -0700
----------------------------------------------------------------------
ui/scripts/storage.js | 9 +++++++--
ui/scripts/ui/widgets/listView.js | 7 ++-----
2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d09b4675/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 8e1f0bd..7d6a963 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -271,8 +271,13 @@
dataProvider: function(args) {
var array1 = [];
- if(args.filterBy != null) {
- if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
+ if(args.filterBy != null) {
+ if(args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") {
+ for(var key in args.filterBy.advSearch) {
+ array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
+ }
+ }
+ else if(args.filterBy.search != null && args.filterBy.search.by != null && args.filterBy.search.value != null) {
switch(args.filterBy.search.by) {
case "name":
if(args.filterBy.search.value.length > 0)
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d09b4675/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index c334f2e..e578120 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -1368,7 +1368,7 @@
//advanced search
var advancedSearch = function(args) {
- page = 1;
+ page = 1;
loadBody(
$table,
listViewData.dataProvider,
@@ -1379,10 +1379,7 @@
page: page,
filterBy: {
kind: $listView.find('select[id=filterBy]').val(),
- search: {
- value: args.data.name,
- by: 'name'
- }
+ advSearch: args.data
}
},
listViewData.actions,