The bellow function is into in the MaterialDataPager class.
/**
Load the datasource within a given offset and limit
*/
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() {
@Override
public void onSuccess(LoadResult loadResult) {
totalRows = loadResult.getTotalLength();
table.setVisibleRange(offset, finalLimit);
table.loaded(loadResult.getOffset(), loadResult.getData());
updateUi();
}
@Override
public void onFailure(Throwable caught) {
GWT.log("Load failure", caught);
//TODO: What we need to do on failure? May be clear table?
}
});
}
When loadResult size is bigger than its previous size, the visible range will be smaller than row count. soo the table dont show all rows...
finalLimit must be calculated in public void onSuccess(LoadResult loadResult) method...
you can test it with remote filtering data table...
and i cannot Override that doLoad function because declaration of offset, dataSource, totalRows , table are private...
The bellow function is into in the MaterialDataPager class.
/**
Load the datasource within a given offset and limit */ 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() {
@Override
public void onSuccess(LoadResult loadResult) {
totalRows = loadResult.getTotalLength();
table.setVisibleRange(offset, finalLimit);
table.loaded(loadResult.getOffset(), loadResult.getData());
updateUi();
}
}); }
When loadResult size is bigger than its previous size, the visible range will be smaller than row count. soo the table dont show all rows...
finalLimit must be calculated in public void onSuccess(LoadResult loadResult) method...
you can test it with remote filtering data table...
and i cannot Override that doLoad function because declaration of offset, dataSource, totalRows , table are private...