• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Question Retrieve data from API for a Plesk Extension

debba

New Pleskian
Hi,

I'm implementing external service API in a Plesk Onyx extension.

I'd like to put in a table a dataset delivered by REST API from the service with a correct pagination (f.e. : if I have 2000 rows of data I want to paginate in 200 pages 10 rows).

I found pm_View_List_Simple class in Plesk documentation (https://docs.plesk.com/en-US/onyx/e...ment-ui/create-new-page/implement-list.76111/), but seems to get work only with fully dataset, so the pagination is only client-side.

The service allow me to retrieve only a group of data (with arguments limit and offset). So with pm_View_List_Simple I'd be forced to cycle each individual request starting from offset 0 and until number of total elements.

Horrible solution! Because total elements could be tens of thousands so lengthy process and useless waste of resources.

I'm still missing something or are there other solutions with Plesk classes?

I am not constrained using pm_View_List_Simple or other Plesk classes, of course. But if it were possible without reinventing the wheel I'd prefer.

I accept your advices!
 
  • Like
Reactions: seb
Back
Top