Dataview Page offset url parameter not used when page is refreshed

I have a sortable pagable searchable table. I can see when the I click the paging arrow the query value updates by testing {{tableSort.data.pageOffset}}

BUT when I refresh the page and the current offset is not used and the arrow state not updated which means you have to click in my case the back arrow for the quey value to register the current paging position and then you can use it normally again.

This would be the url: /dashboard?pageOffset=2

But on refresh the dataview in fact show /dashboard?pageOffset=1 despite he url being /dashboard?pageOffset=2

This is my dataview code:

<dmx-data-view id="memberList" dmx-bind:data="serverconnectAdvisorUsers.data.repeatAdvisorUsers" dmx-bind:sorton="tableSort.data.sort" dmx-bind:page="tableSort.data.pageOffset" dmx-bind:pagesize="tableSort.data.pageSize||10" dmx-bind:sortdir="tableSort.data.dir" filter="firstName.lowercase().fuzzySearch(searchInput.value.lowercase())||lastName.lowercase().fuzzySearch(searchInput.value.lowercase())"></dmx-data-view>

How can I keep the state of page offset which shows in the url to be the one used by dataview?

What is this value actually?

dmx-bind:page="tableSort.data.pageOffset"

Aren't you supposed to bind the query parameter there - query.pageOffset?

You are right, my paging was previously set up with session variables and now changed to the correct query manager with parameter, But is still does not work when a page is refreshed. I still only get page 1 everytime I refresh.

Code now reads:

<dmx-data-view id="memberList" dmx-bind:data="serverconnectAdvisorUsers.data.repeatAdvisorUsers" dmx-bind:sorton="query.sort" dmx-bind:page="query.pageOffset" dmx-bind:pagesize="query.pageSize||10" dmx-bind:sortdir="query.dir" filter="firstName.lowercase().fuzzySearch(searchInput.value.lowercase())||lastName.lowercase().fuzzySearch(searchInput.value.lowercase())"></dmx-data-view>

Do you have a link to your page where i can check this?

Unfortunately not - can only be accessed via vpn. I will continue troubleshooting.

Hi @pixlapps Marcel

mmm.. can i make a suggestion...

The "server connect" serverconnectAdvisorUsers.... that is the Paged Query... so rather than having the dmx-bind:page="query.pageOffset" dmx-bind:pagesize="query.pageSize||10" on the dmx-data-view...

use it with your paged query... as that works with your pagination.. ???

so ja ... dmx-serverconnect paged query to control the pagination requests
and dmx-data-view to only repeat your data but not control the offset and limit....

eg..
<dmx-serverconnect id="serverconnectAdvisorUsers" url="dmxConnect/api/....." dmx-param:offset="query.pageOffset" dmx-param:limit="query.pageSize||10" dmx-param:sort="query.sort" dmx-param:dir="query.dir"></dmx-serverconnect>

See link below as you can refresh and it will retain the offset

1 Like