Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,20 @@ public boolean isLastPage() {
protected void doLoad(int offset, int limit) {
this.offset = offset;

// Check whether the pager has excess rows with given limit
if (isLastPage() & isExcess()) {
// Get the difference between total rows and excess rows
limit = totalRows - offset;
}

int finalLimit = limit;
dataSource.load(new LoadConfig<>(offset, limit, table.getView().getSortContext(),
table.getView().getOpenCategories()), new LoadCallback<T>() {
@Override
public void onSuccess(LoadResult<T> loadResult) {
totalRows = loadResult.getTotalLength();

int finalLimit = limit;

// Check whether the pager has excess rows with given limit
if (isLastPage() & isExcess()) {
// Get the difference between total rows and excess rows
finalLimit = totalRows - offset;
}

table.setVisibleRange(offset, finalLimit);
table.loaded(loadResult.getOffset(), loadResult.getData());
updateUi();
Expand Down