Paging return to a populated page if last existing row in a page is deleted

Is there a way to automatically return to page 1 if the last row on page 2 of a table with paging is deleted?

For instance limit is set to 15. Record 16 is deleted on page 2. Currently page stays on an empty page 2.

UX would be better if it resets to the previous “full” page.

Maybe on delete you can check if current page > total pages and if yes, then do a page change back.

1 Like

ok cool, would I use Page/App flow for this?

Actually, since it was introduced in Wappler I don’t think I have ever used Page/App flow… :grimacing:

I used page flow and got this far when running the flow on delete form success, but something in my code is wrong. I think it is the run action?

<script is="dmx-flow" id="flowResetPageOnDelete" type="text/dmx-flow">{ condition: { if: "{{serverconnectNotesList.data.queryNotesList.page.current>serverconnectNotesList.data.queryNotesList.page.total}}", then: { steps: { run: { action: "{{queryEmployersList.set('notesOffset',(page-1)*serverconnectNotesList.data.queryNotesList.limit)}}", name: "reset" } } } } }</script>

Bump.

Shouldn’t you do the check after serverconnectNotesList has been loaded and you know the new page total.

1 Like

Thanks @patrick - that did the trick!