First of all, make backup copies of your files.
Step 1.
This is example of event hocking, put it in config.xml
01.
<adminhtml>
02.
<events>
03.
<core_block_abstract_prepare_layout_before>
04.
<observers>
05.
<reward>
06.
<
class
>grid/observer</
class
>
07.
<method>applyLimitToGrid</method>
08.
</reward>
09.
</observers>
10.
</core_block_abstract_prepare_layout_before>
11.
12.
</events>
13.
</adminhtml>
Step 2.
Create model class observer.php
01.
class
Inchoo_Grid_Model_Observer
02.
{
03.
04.
public
function
applyLimitToGrid(Varien_Event_Observer
$observer
)
05.
{
06.
$block
=
$observer
->getEvent()->getBlock();
07.
if
((
$block
instanceof Mage_Adminhtml_Block_Widget_Grid) &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; !(
$block
instanceof Mage_Adminhtml_Block_Dashboard_Grid))
08.
$block
->setDefaultLimit(200);
09.
10.
}
11.
12.
}
It would be good that you make your own module and all put in it. I hope that you know how to make magento module.
No comments:
Post a Comment