Pagination not working when delete last item from the list
Question
Application Type
Reactive

Hi All,

I'm working on a scenario where I'm showing a pagination in a listing page and there is a delete action for every item.

When I delete the last item of any page the pagination will not work properly and will not load the pagination number and the content in a proper manner. 

It will happen only when I delete the last record of every page.

Please suggest me any idea for this. Find the image for the reference.

Thanks

Prince Kumar

paginationimage.jpg

Solution

Hi Buddy,

You have to do some manual assign and condition on delete.
Use below If condition after delete
StartIndex<(GetDataById.Count/10)*10

and after that assign below on false
StartIndex-MaxRecords

This is working fine for me

Please mark solution if works

Thanks @Yogesh Javir, for your reply. It works for me :) 

Thanks 

Prince

Hello Prince,

At the end of your delete action are you using the RefreshData from the listing?

Regards,

Jorge Rodrigues

Thanks for the reply, Jorge

Yes, I'm refreshing the data from listing. Can see the image below

img2.PNG

Can you send the OML file for me to analyze?

Hi,

Please take a look at this sample, and .oml attached.

Cheers,

Khuong

ListDemo.oml

Thanks for the reply Khuong, 

But this functionality already done in the application on page navigate. 

This will work while navigating the page only when we click on the pagination. 

But my issue is like if I'm deleting the record one by one until unless there will be one record left in the list in a page. (for ex. Page No.3 - only 1 record remain) and If I delete the last record as well the pagination data got change and It will not return the Page-2 and the list also not show any item as I'm showing in the image above.

Thanks

Prince

Solution

Hi Buddy,

You have to do some manual assign and condition on delete.
Use below If condition after delete
StartIndex<(GetDataById.Count/10)*10

and after that assign below on false
StartIndex-MaxRecords

This is working fine for me

Please mark solution if works

Thanks @Yogesh Javir, for your reply. It works for me :) 

Thanks 

Prince

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.