Magento 1.9: How to Add Pagination to Custom Collection in Admin Tab Content

magento-1.9pagination

I have added a custom tab in customer admin view.

My tab class content is :

class Namespace_Modulename_Block_Adminhtml_Customer_Edit_Tab
extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface 
{
    public function __construct()
    {
        $this->setTemplate('tab/tab.phtml');
    }
}

And in tab.phtml I have custom collection and want to add pagination.

How to add pagination for custom collection here?

Best Answer

I got a solution :

I created a grid.php in my custom module for custom collection and add grid in tab.phtml as below :

echo $this->getLayout()->createBlock('custom/adminhtml_path_grid')->toHtml();