2

I want to be able to page through this data and I was wondering if Magento supports the ability to force a new call into the model whenever a user clicks on the next button, or the previous button.

E.g. instead of pulling in all of the data in one trip the web service call, I want to be able to request the appropriate data based on the current page, the current sort order, etc.

I would like to be able to do this with the standard products database table as well.

Can this be done?

One issue I see is first obtaining the total number of records available, so that the pager control knows how many page selector links to display.

1
  • I don't understand what you want. What "data" are you talking about? You want to fire a query to a web service and get some data? Where is the connection to the current page and sort order? Dec 24, 2013 at 11:22

1 Answer 1

2

You can get custom url parameters in your controller and use that to decide how much data to get. The default value of how much to display can be set by you in the controller, or via a setting in the back-end. Then your prev/next urls would have the params needed to get the next set of data. How you implement this depends more on what the remote service requires and if you can request specific sets of data.

This post shows you how to get those values in the request.

https://stackoverflow.com/questions/8430214/how-to-capture-an-url-parameter-magento

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.