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.
This commit is contained in:
bfederle 2012-07-17 11:38:56 -07:00
parent dfb0eed5a4
commit 2b2e491f27

View File

@ -974,8 +974,8 @@
if (!options) options = {}; if (!options) options = {};
var context = options.context; var context = options.context;
var reorder = options.reorder; var reorder = options.reorder;
var $tbody = $table.find('tbody'); var $tbody = $table.find('tbody');
if (!loadArgs) loadArgs = { if (!loadArgs) loadArgs = {
page: 1, page: 1,
filterBy: { filterBy: {
@ -1262,6 +1262,7 @@
}); });
var search = function() { var search = function() {
page = 1;
loadBody( loadBody(
$table, $table,
listViewData.dataProvider, listViewData.dataProvider,
@ -1269,7 +1270,7 @@
listViewData.fields, listViewData.fields,
false, false,
{ {
page: 1, page: page,
filterBy: { filterBy: {
kind: $listView.find('select[id=filterBy]').val(), kind: $listView.find('select[id=filterBy]').val(),
search: { search: {
@ -1317,6 +1318,7 @@
if (loadMoreData) { if (loadMoreData) {
page = page + 1; page = page + 1;
loadBody($table, listViewData.dataProvider, listViewData.preFilter, listViewData.fields, true, { loadBody($table, listViewData.dataProvider, listViewData.preFilter, listViewData.fields, true, {
context: context, context: context,
page: page, page: page,