I want to load my grid class within constructor method of other block.I try this peace of code but don't succeed.

`class Mymodule_Block_Adminhtml_Sales_Order_View_Tabs  extends 
        implements Mage_Adminhtml_Block_Widget_Tab_Interface

        protected $_chat = null;

        protected function _construct()
               $class = Mage::getConfig()->getBlockClassName('mymodule/adminhtml_mymodule_edit_tab_tickethistory');   
                $block = new $class;
               $block-> _prepareCollection();

    } .

I can set phtml file here but my requirement is to load grid class.how can i do that ? Thanks in advance


You can load a block like this:


in your case:


but what you are trying to do won't work because _prepareCollection() is a protected method. You can only call it inside the class methods or it's descendants.
I think it's better to explain the problem you have, not the problems you have while implementing the solution. Maybe someone has a better idea on how to do it.

  • Thanks for your respons.If you look at my question (" stackoverflow.com/questions/17187278/… solve it .After that I face current problem that how can now load grid instead of phtml.Hope you got point
    – MKK
    Jun 20 '13 at 7:54

Your Answer

