I have idea about adding vertical tab in form, just put below code in your tabs.php file of your module in _beforeToHtml() function
$this->addTab('tabid', array(
'label' => Mage::helper('modulename')->__('Name of tab'),
'class' => 'ajax',
'url' => $this->getUrl('*/*/action controller name', array('_current' => true)),
));
just give tabid whatever you want and in url give action name add this function also in your tabs.php file for handle tab update
and call $this->_updateActiveTab(); in _beforeToHtml() function
protected function _updateActiveTab()
{
$tabId = $this->getRequest()->getParam('tab');
if ($tabId) {
$tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
if ($tabId) {
$this->setActiveTab($tabId);
}
}
else {
$this->setActiveTab('form_section');
}
}
add action in controller something like this
public function yourAction()
{
$id = (int) $this->getRequest()->getParam('id');
$model = Mage::getModel('modulename/modulename');
if ($id) {
$model->load($id);
}
Mage::register('modulename_data', $model);
$this->getResponse()->setBody($this->getLayout()
->createBlock('modulename/adminhtml_modulename_edit_tab_tabid')->toHtml());
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…