cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

Issue using Dataset Paging

Hi Team,

 

We are facing some issues while making use of a few of the documented functionalities of dataset paging. I’d list down each one of them along with the issue being faced.

 

  1. parameters.sampledataset.paging.loadNextPage() – While using this, it doesn’t give us the data only for next page, but it gives data for the current page + next page i.e., say on my current page I have 50 records and on next page I have 25 records, then I get 75 records.
  2. parameters.sampledataset.paging.reset() – Reset, at time doesn’t reset the page to Page Number 1. It just stays on the same page,when we are changing page by loadNextPage() and loadPreviousPage().But when I change the page of OOB grid and then switching to my control then reset page and other function are working
  3. parameters.sampledataset.paging.hasPreviousPage – This doesn’t return true, if we use context.parameters.sampledataset.paging.loadPreviousPage()
  4. parameters.sampledataset.paging.loadPreviousPage() – This doesn’t work once we reach to the last page

5.context.parameters.gridPageNumber - Is this a supported method to get the current page number, when I switching for the OOB grid to control then it gives the correct page number except for the first page but for rest, it gives the correct page number.But if I loadNext or previous page using  loadPreviousPage() or loadNextPage() it doesn't give page number

I have other few questions, is there a way to get the values of the next page only, i.e., if next page has 25 records then just get 25 records.

 

Also, is there a way to get the current page number?

22 REPLIES 22
Resolver I
Resolver I

Hi Team,

 

Any help on this would be really appreciated.

 

Thanks!

New Member

Hi,

 

we also facing same issue please help on same.

 

Thanks!

hi Ashwini,

 

1) The behavior of loadNextPage is suppose the [firstpage, lastpage] is [1,1]

If using loadNextPage, it will turns to [1,2] , we will load page 2 data for u, along with existed page. Similarly, if loadNextPage again, it will be [1,3]

And as the records range is already [1,2], there is no previous page before 1 to be retrieved, so hasPreviousPage turns to false

 

2) If needs to retrieve the exact page 2 data, just use loadExactPage(N), or any number u want. It will jump to [2,2]

 

3) reset makes the range turns to [1,1]

 

4) We do not suggest use gridPageNumber, it's not supported. It needs to track the current page number in the code

 

5) On mobile device, loadNextPage multiple times, it will start to add more records, so at one point, the data will be a range like [3,7]. The start point won't always be 1

 

Feel free to let us know if there are questions

 

@AnqiChen 

 

Can you please throw more light on loadExactPage(N). I tired it this doesn't seems to be working.

 

I also want to achieve the functionality where i just need to load only next page records not all the records.Like the OOB subgrid works.

Hi @AnqiChen ,

 

We were successfully able to make use of loadExactPage(N), but, then we faced a couple of issues doing so, 

 

- The loadExactPage, doesn't return data on the first UpdateView call, it returns data when the loadExactPage is invoked again. Basically, for the first time (after page refresh), we have to click twice in order to get the desired result.

 

-  If using loadExactPage, we are moving forward i.e., from Page 1 to Page 2 to Page 3, it gives proper data of the respective page only, but, if we try going backward i.e., from Page 3 to Page 2 to Page 1, it again sums up all the data i.e., if the page size is 50 then going backward from Page 3 to Page 1, would return 150 records.

 

Do we have any way of knowing the current page number, it gets difficult to know the page number when the user has traversed through a couple of pages using OOB grid and then switches to the PCF control?

 

Please help me with this.

 

Thanks in advance for your assistance.

@sheldoncopper73 

 

What did you pass in N in loadExactPage(N) ?

Hi @Bhuvita ,

 

We invoked it as loadExactPage("2").

 

Note:  You need to click your button (the one which invokes loadExactPage(N) method) twice for the first time after page loads. Clicking the button once, won't invoke UpdateView for the very first time after page load. (This could be a probable bug.)

@sheldoncopper73 

Thanks for your reply.

Is there any way we can get the current page number so that we don't need to hardcode the page number.

@Bhuvita 

 

We were trying to make use of gridPageNumber, but, @AnqiChen  said that it is unsupported. Even we'd be interested in knowing if there is any way of knowing the current page number.  

 

We already have raised a couple of issues that we faced while implementing loadExactPage(N). 

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (50,713)