incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: CS-15572: Fix page index for list view filters
Date Tue, 17 Jul 2012 18:43:09 GMT
Updated Branches:
  refs/heads/master dfb0eed5a -> 2b2e491f2


CS-15572: Fix page index for list view filters

This fixes an issue where the page index is not reset back 1 when
activating the search or filter functionality, causing truncation when
trying to scroll down to later pages.


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

Branch: refs/heads/master
Commit: 2b2e491f27a1485338557a775e5c21179a19b32b
Parents: dfb0eed
Author: bfederle <bfederle@gmail.com>
Authored: Tue Jul 17 11:38:56 2012 -0700
Committer: bfederle <bfederle@gmail.com>
Committed: Tue Jul 17 11:41:53 2012 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/2b2e491f/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index b01d01e..087f540 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -974,8 +974,8 @@
     if (!options) options = {};
     var context = options.context;
     var reorder = options.reorder;
-
     var $tbody = $table.find('tbody');
+
     if (!loadArgs) loadArgs = {
       page: 1,
       filterBy: {
@@ -1262,6 +1262,7 @@
     });
 
     var search = function() {
+      page = 1;
       loadBody(
         $table,
         listViewData.dataProvider,
@@ -1269,7 +1270,7 @@
         listViewData.fields,
         false,
         {
-          page: 1,
+          page: page,
           filterBy: {
             kind: $listView.find('select[id=filterBy]').val(),
             search: {
@@ -1316,7 +1317,8 @@
         var context = $listView.data('view-args').context;
 
         if (loadMoreData) {
-          page = page + 1;					
+          page = page + 1;
+
           loadBody($table, listViewData.dataProvider, listViewData.preFilter, listViewData.fields,
true, {
             context: context,
             page: page,


Mime
View raw message