Extjs之Ajax的运用

  • Ext.Ajax并不是一个类,而是一个对象,因此,我们不用实例化它;
  • Ext.Ajax有个很重要的方法:requeset(),这个方法是实现ajax的前提和基础;
  • Extjs自身已经实现了ajax异步传输机制,代码如下:
Ext.Ajax.request({
	url : Global_Path + '/manage/flow/operauth/modifyname.do?method=approval',
	method : 'post',
	params : {
		approval : Ext.encode(histroyForm.getForm().getValues())
		},
	success : function(response, opts) {
		var retMsg = Ext.decode(response.responseText);
		if ('true' == retMsg.__msg){
			Ext.Msg.alert('消息', '审批成功!', function(){
				centerPanel.getLayout().setActiveItem(0);
				centerGrid.getStore().reload();
				});    
		 } else {
		   	Ext.Msg.alert('消息', '审批失败,请联系管理员!');
		 }
		},
	failure : function(response, opts) {
		Ext.Msg.alert('消息', '审批失败,请联系管理员!');
		}
	});

猜你喜欢

转载自damon-zhang.iteye.com/blog/1774682