Extjs之Ajax的运用

前端之家收集整理的这篇文章主要介绍了Extjs之Ajax的运用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  • Ext.Ajax并不是一个类,而是一个对象,因此,我们不用实例化它; @H_404_2@
  • Ext.Ajax有个很重要的方法:requeset(),这个方法是实现ajax的前提和基础; @H_404_2@
  • Extjs自身已经实现了ajax异步传输机制,代码如下: @H_404_2@
  1. Ext.Ajax.request({ @H_404_2@
  2. url : Global_Path + '/manage/flow/operauth/modifyname.do?method=approval',@H_404_2@
  3. method : 'post',@H_404_2@
  4. params : { @H_404_2@
  5. approval : Ext.encode(histroyForm.getForm().getValues()) @H_404_2@
  6. },@H_404_2@
  7. success : function(response,opts) { @H_404_2@
  8. var retMsg = Ext.decode(response.responseText); @H_404_2@
  9. if ('true' == retMsg.__msg){ @H_404_2@
  10. Ext.Msg.alert('消息','审批成功!',function(){ @H_404_2@
  11. centerPanel.getLayout().setActiveItem(0); @H_404_2@
  12. centerGrid.getStore().reload(); @H_404_2@
  13. }); @H_404_2@
  14. } else { @H_404_2@
  15. Ext.Msg.alert('消息','审批失败,请联系管理员!'); @H_404_2@
  16. } @H_404_2@
  17. },@H_404_2@
  18. failure : function(response,opts) { @H_404_2@
  19. Ext.Msg.alert('消息','审批失败,请联系管理员!'); @H_404_2@
  20. } @H_404_2@
  21. }); @H_404_2@

猜你在找的Ajax相关文章