2

i am adding the mass action from observer that are work perfectly but after the ajax load grid it is not working. cannot show the additional form.

copying this code from Mage_Adminhtml_Block_Customer_Grid

$groups = $this->helper('customer')->getGroups()->toOptionArray();

        array_unshift($groups, array('label'=> '', 'value'=> ''));
        $this->getMassactionBlock()->addItem('assign_group', array(
             'label'        => Mage::helper('customer')->__('Assign a Customer Group'),
             'url'          => $this->getUrl('*/*/massAssignGroup'),
             'additional'   => array(
                'visibility'    => array(
                     'name'     => 'group',
                     'type'     => 'select',
                     'class'    => 'required-entry',
                     'label'    => Mage::helper('customer')->__('Group'),
                     'values'   => $groups
                 )
            )
        ));


$orderstatus = Mage::helper('modulename')->getStatus();

            array_unshift($orderstatus, array('label'=> '', 'value'=> ''));
                $block->addItem('orderstatus', array(
                    'label' => 'Order Status',
                    'url' => $url,

                    'additional'   => array(
                    'visibility'    => array(
                         'name'     => 'status',
                         'type'     => 'select',
                         'class'    => 'required-entry',
                         'label'    => Mage::helper('modulename')->__('Status'),
                         'values'   => $orderstatus
                     )
                )


                ));

any help will be appreciated.

  • could you show us your complete code as this snippet is probably not enough to get a good answer from. – David Manners May 18 '15 at 16:18
  • this method i used in observer to add action in order gird but after ajax call sub option are not working. – Qaisar Satti May 18 '15 at 16:22
  • update my question check it – Qaisar Satti May 18 '15 at 17:24
  • What do you mean after the ajax call? – Tim Hallman May 20 '15 at 4:38
  • grid ajax call. when grid content update with ajax – Qaisar Satti May 20 '15 at 4:39
3
+50

After carefully examine your code so i found where is your problem. it is prototype handler problem. can not create the handler for this action. if i edit the core file it is working other after ajax reload grid it is not working. So i create the simple solution add my javascript function on ajax call and it is working.

so finally you add this function in your code and your problem will be resolved:

<script type="text/javascript">
    $("sales_order_grid_massaction-select").observe("change", function(event) {
      $("sales_order_grid_massaction-form-additional").update($("sales_order_grid_massaction-item-set_subgroup-block").innerHTML);
});
</script>
| improve this answer | |
  • thanks for your attempt it is not magento way of doing but at least solve the problem.. – Qaisar Satti May 21 '15 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.