This is a migrated thread and some comments may be shown as answers.

Keeping pageSize "All" when datasource refresh gets more records

1 Answer 418 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 14 Jun 2017, 05:42 PM

We have a grid configured with the "all" page size in the options: 

this.gridOptions.pageable = <kendo.ui.GridPageable>{
                input: true,
                numeric: false,
                pageSizes: ["all", 5, 10, 20, 50],
                refresh: true
            };

 

When we programmatically refresh the grids datasource (below), and that refresh pulls in an additional item to display in the grid, the pager in the grid is no longer what we'd expect. 

this.manageGridDataSource.read();

 

If the grid had 9 items before, the pager now shows 9, and the new item is now on page two. I understand that the "all" selection just sets the pageSize to the total number of items in the datasource, but what we want to happen is that after the refresh, the "all" setting is preserved and the additional grid item displays on the first page, not generate a second page of data. 

Do you know how this can be achieved? 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Jun 2017, 07:26 AM
Hello Adam,

Based on the provided information it seems the pageSize property of the dataSource is set to 9, as otherwise when a new item is added it should stay on the same page:

http://dojo.telerik.com/unujO

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-pageSize

In this scenario, I can suggest to either remove the set pageSize or to set it to the number after which the new items should go to the next page.

If additional assistance is needed, please provide a runnable example, and I will gladly assist.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Adam
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or