开发者

Ajax request in magento module

开发者 https://www.devze.com 2023-04-12 13:18 出处:网络
I developing magneto module, In this module i want to make a ajax request in admin panel.I don\'t understand were to add script and controllers.please help me.

I developing magneto module, In this module i want to make a ajax request in admin panel.I don't understand were to add script and controllers.please help me.

My requirement:

When change the select box(On change) i want add some field in the form.

Mycode:

/app/code/local/<Namespace>/<Module>/Block/Adminhtml/<Module>/Edit/Tab/Form.php


    $fieldset->addField('type', 'select', array(
                'label'开发者_开发知识库     => Mage::helper('<Module>')->__('Article Type'),
                'name'      => 'status',
                'values'    => array(
                array(
                        'value'     => '',
                        'label'     => Mage::helper('<Module>')->__('Choose'),
                    ),
                    array(
                        'value'     => 1,
                        'label'     => Mage::helper('<Module>')->__('Normal'),
                    ),

                    array(
                        'value'     => 2,
                        'label'     => Mage::helper('<Module>')->__('video'),
                    ),
                ),
            'required'  => true
            ));

I am creating fields using this.

  1. How can i add another field on change.
  2. Where should i add script
  3. Where should i add controller

I created this module using this instructions


  1. Let this field always be on the form. But make it invisible and show when you need it.
  2. In the same template where the form is.
  3. Place controller in your module. On stackoverflow you can find many questions about creating your own magento module and controller.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号