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

pager issue on filtered data

1 Answer 10 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frederic
Top achievements
Rank 1
Veteran
Frederic asked on 23 Feb 2021, 06:41 PM

When I use paging + filtering on the grid, and I edit my data, that makes the view change size, the pager is not updated.

https://dojo.telerik.com/@foxontherock/iminugeH/3

Click on the "filter" button, that changes all "number" field to make them visible on the view.

When you click on the pager, it correctly refreshes.

That can be fixed by adding a "kgrid.pager.refresh()" on the grid dataBound, but I think it should be fixed on your side.

 

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 26 Feb 2021, 02:59 PM

Hi Frederic,

Thank you for the shared Dojo example and the detailed description of your query!

I would suggest you call the DataSource read() method in the 'click' event handler of the filter button. This way the updated data will be reloaded in the Grid and it will update the pager:

$('#filter').click(() => {
  data.forEach(d => d.number += 1000);
  data[0].set("abc", "def"); 
  kgrid.dataSource.read();
});

It's recommended to call it after any changes to the initial data.

I have updated the demo as well:

https://dojo.telerik.com/ILOJeyUG

As per the modification of the first data item, I could see that it is being applied. However, since there is no 'abc' field the JavaScript object will create a new one for you. In order to verify this, you should introduce a new column.

If you have any additional queries, please let me know. 


Regards, Mihaela Lukanova Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Frederic
Top achievements
Rank 1
Veteran
Answers by
Mihaela
Telerik team
Share this question
or