I have a datatable which loads data dynamic from Server and I have a paginator now I want to jump to a specific page or to the last page. I don’t know how to set it up programmatically…
And please for a help.
Thank you!
Michael
I have a datatable which loads data dynamic from Server and I have a paginator now I want to jump to a specific page or to the last page. I don’t know how to set it up programmatically…
And please for a help.
Thank you!
Michael
Hello @Michael ,
There are two ways to set a specific page or the last page in datatable with the dynamic load that uses pager:
use can use pager.
When pagination occurs, the component will automatically issue a request based on the data source. But your server script should be able to handle the parameters continue, count, start.
More information about paging in datatable you can find in this article. and the information about dynamic loading in datatable you can read here.
Please check the example: Code Snippet
another way is to use standlong pager. In this case, it is necessary to process the logic for the pager and for the table separately using loadNext method. In this method you can define proxy where the behavior of the datatable should be described when the pager is clicked (row 5 in the example below). Also you’ll have to handle the logic of the standalong pager (row 62).
More information about dynamic loading with api you can find in this article.
Please check the example: Code Snippet
Hello Natalia.
Thank you so much but I didn’t understand. Supposed I have dynamic datatable with paginator.
Normely, when I add a row in the datatable I will go back to load the new content of the datatable but then my datatable starts from the beginning. But the added dataset is on the last page f.i. page 10. Is there a way to have a programmatically click trigger to the last page so my datatable does not load data from the first page but from the last one?
Michael
Hello @Michael ,
If you mean to show the last page after adding the item into the grid, you can use select method of the pager this way:
$$("pagerB").select("last");
Please take a look at the example: Code Snippet
Dear Natalia.
This works for me.
Thank you ![]()