dongxin2734 2015-11-04 19:11
浏览 36
已采纳

来自Module的Magento Ajax

I am new to magento module development. I want to request ajax call from magento backend.. Here I made module... Here is the screenshot enter image description here

I have fields like this:

<tpropay translate="label" module="tpropay">
                <label>Tpro3</label>
                <sort_order>670</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>0</show_in_store>
                <comment><![CDATA[ 
                <button class="scalable" onclick="return check(); ">Sync Products Now</button>  ]]></comment>

<fields>
 <active translate="label">
   <label>Enabled</label>
   <frontend_type>select</frontend_type>
   <source_model>adminhtml/system_config_source_yesno</source_model>
   <sort_order>1</sort_order>
   <show_in_default>1</show_in_default>
   <show_in_website>1</show_in_website>
   <show_in_store>0</show_in_store>
 </active>
</fields>
</tpropay>

Now I want ajax call when user click on button? Confused about how to include javascript and send ajax call... Any help would be appreciated

  • 写回答

1条回答 默认 最新

  • dongyi2889 2015-11-05 09:35
    关注

    Create your controller, to which you are going to call ajax then put your JavaScript in a file and add that js file by layout xml like below

    <adminhtml_system_config_edit> <reference name="head"> <action method="addJs"><script>folder/ajax.js</script></action> </reference> </adminhtml_system_config_edit>

    Hope that helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真