Where is onclick event function?
-
16-10-2019 - |
Question
I'm new to magento. I go through the Catalog->Manage Products module to understand the coding & design, i seen that everything (design and coding and controller actions) in block and controllers is there except submit button code?
can you anyone tell me where is the submit button design & code and how that button works?
if I added the custom action to perform that action where I write code?
thanks in advance.
Solution
this is something you can find around Mage_Adminhtml_Block_Widget_Grid
class, check it's _prepareMassaction
method. This is where that button comes from.
Specifically, for products grid page check out file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
for better understanding.
This is specific part of code in that file that reflects as "Delete" item in dropdown on your screen:
$this->getMassactionBlock()->addItem('delete', array(
'label'=> Mage::helper('catalog')->__('Delete'),
'url' => $this->getUrl('*/*/massDelete'),
'confirm' => Mage::helper('catalog')->__('Are you sure?')
));