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 2012/10/12 04:25:50 UTC
[47/50] git commit: cloudstack UI - listView widget - keep advanced
search criteria when scrolling down grid when the last search is from
advanced search dialog.
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/javelin
Commit: a5c9c560ffca028fd3fe6576091e5196a91a67a0
Parents: a2a1e19
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Oct 4 16:29:10 2012 -0700
Committer: Jessica Wang <je...@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
});