On-page-change event for data grids

Checking the docs… Nothing new in https://anvil.works/docs/api/anvil#DataGrid_attributes .

Agree with your Edit. Anyone who has such issues needs a Custom Component wrapper, or at least supplemental methods (a Custom nav bar?), to allow enforcement of such issues.

Here’s another: if you have an N-page grid, and you need to refresh the underlying data regularly, say, every 30 seconds or so, you may end up refreshing in the middle of the user’s navigation. They’re paging forward to page 15, say, but before they get there, the timer ticks, and suddenly, the data is refreshed out from under them. And it’s refreshed out from under Form code, too. This can raise Python exceptions.

And even if it doesn’t, suddenly they’re back at page 1!

For this reason, I had planned to turn timed refresh off, in several of my grids. Let the user refresh manually, e.g., via button. That way, we’re guaranteed to do all the steps in the right order. But your approach – custom navigation buttons – might give me a way to address this.

1 Like