I want custom grid in tab
I have created a custom module in the admin panel and now want to create a grid to show, filter, etc the data under a tab from a custom table. As like below screen
Right Now My tab comes like as bellow screen
I have added a Tab in Tab.php file
class Bluehorse_Warehouse_Block_Adminhtml_Warehouse_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
{
public function __construct()
{
parent::__construct();
$this->setId('warehouse_tabs');
$this->setDestElementId('edit_form');
$this->setTitle(Mage::helper('warehouse')->__('Warehouse '));
}
protected function _beforeToHtml()
{
$this->addTab('warehouse', array(
'label' => Mage::helper('warehouse')->__('Warehouse Information'),
'title' => Mage::helper('warehouse')->__('Warehouse Information'),
'content' => $this->getLayout()->createBlock('warehouse/adminhtml_warehouse_edit_tab_form')->toHtml(),
));
$this->addTab('zipcoe', array(
'label' => Mage::helper('warehouse')->__('Associated Zip Code'),
'title' => Mage::helper('warehouse')->__('Associated Zip Code'),
'url' => $this->getUrl('*/*/pincodes', array('_current' => true)),
'class' => 'ajax',
));
return parent::_beforeToHtml();
}
}
Added a function
class Bluehorse_Warehouse_Adminhtml_WarehouseController extends Mage_Adminhtml_Controller_Action
{
public function pincodesAction () {
//
}
................
There are my two tables one is
+--------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| firstname | varchar(255) | NO | | | |
| lastname | varchar(255) | NO | | | |
| phone | varchar(255) | NO | | | |
| email | varchar(255) | NO | | | |
| username | varchar(255) | NO | | | |
| password | varchar(255) | NO | | | |
| name | varchar(255) | NO | | | |
| zone | varchar(255) | NO | | | |
| zipcode | varchar(255) | NO | | | |
| address | text | NO | | NULL | |
| status | smallint(6) | NO | | 0 | |
| created_time | date | YES | | NULL | |
| update_time | date | YES | | NULL | |
+--------------+------------------+------+-----+---------+----------------+
Second is
+---------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| wid | varchar(255) | NO | | NULL | |
| zipcode | varchar(255) | NO | | NULL | |
| is_primary | varchar(255) | NO | | 0 | |
| delivery_time | varchar(255) | NO | | NULL | |
| status | smallint(6) | NO | | 0 | |
| position | smallint(6) | NO | | 0 | |
| created_at | timestamp | YES | | NULL | |
| updated_at | timestamp | YES | | NULL | |
+---------------+------------------+------+-----+---------+----------------+
I want to showing a grid under my blank tab. How can do it? Can you help me.
I also take help from
How to create the Product Grid Serializer Block In Custom module