You need to sign in to do that
Don't have an account?
Pubali Banerjee 2
On applying pagination, when a data table is updated in the second page, the page refreshes to first page after save in lightning
Issue description:
My code is working properly when it comes to updating the datatable. Pagination also works fine. Issue is, every page i am displaying 50 records. Now if i go to my second page, update any record and save, the record is getting saved BUT the page is refreshing back to the first page. Is there any way that if any record from 2nd page is updated, after hitting save button, the page refreshes back to the same page and display the updated data instead of refreshing back to the main page.
My code is working properly when it comes to updating the datatable. Pagination also works fine. Issue is, every page i am displaying 50 records. Now if i go to my second page, update any record and save, the record is getting saved BUT the page is refreshing back to the first page. Is there any way that if any record from 2nd page is updated, after hitting save button, the page refreshes back to the same page and display the updated data instead of refreshing back to the main page.
page = 2;
Please put this.displayRecordPerPage(page) where you are updating your record in code , thia method will call after your DML operation.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
You can call your this.displayRecordPerPage() with the page number as argument from your publicSaveFunction method after the call to refreshApex. Pass to this.displayRecordPerPage() the value of this.page
page = 2;
Please put this.displayRecordPerPage(page) where you are updating your record in code , thia method will call after your DML operation.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh