I am trying to applying magento pagination on custom object but not able to do it properly. Problem is my object is not an db object, I am calling an API which returns data in json format. I am converting the data into array first and then trying to convert that array into collection object. The pager calculates the page numbers correctly. It seems like it is not able to apply limits on the collection. All the items show on all the pages. This is how i am doing it -
$collection = new Varien_Data_Collection();
foreach($order['data']['orderlist'] as $row){
$rowObj = new Varien_Object();
$rowObj->setData($row);
$collection->addItem($rowObj);
}
Please let me know how can i apply the limits correctly on each page. Any help would be much appreciated.