Skip to content

Commit a9f0fb8

Browse files
isaacchiangpranavs
authored andcommitted
CLOUDSTACK-2076:Listview widget infinte scrolling error
1 parent 5811ae7 commit a9f0fb8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ui/scripts/ui/widgets/listView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,9 @@
16871687
return false;
16881688
});
16891689

1690+
var tableHeight = $table.height();
1691+
var endTable = false;
1692+
16901693
// Infinite scrolling event
16911694
$listView.bind('scroll', function(event) {
16921695
if (args.listView && args.listView.disableInfiniteScrolling) return false;
@@ -1697,7 +1700,7 @@
16971700
var loadMoreData = $listView.scrollTop() >= ($table.height() - $listView.height()) - $listView.height() / 4;
16981701
var context = $listView.data('view-args').context;
16991702

1700-
if (loadMoreData) {
1703+
if (loadMoreData && !endTable) {
17011704
page = page + 1;
17021705

17031706
var filterBy = {
@@ -1725,6 +1728,7 @@
17251728
reorder: listViewData.reorder,
17261729
detailView: listViewData.detailView
17271730
});
1731+
$table.height() == tableHeight ? endTable = true : tableHeight = $table.height();
17281732
}
17291733
}, 500);
17301734

0 commit comments

Comments
 (0)