action
。。。。。
this.getResponse().setCharacterEncoding("UTF-8");
this.getResponse().getWriter().write(“String”);
this.getResponse().getWriter().flush();
js
var recordDef = Ext.data.Record.create([
/*{
name : 'merchantname',
mapping : 'merchantname',
type : 'string'
}, */
{
name : 'accountMoney',
mapping : 'accountMoney',
type : 'string'
} ]);
Ext.Ajax.request({
url : 'accountBalance__getAccountMoney.action',
params : {
merchantId : searchmerchantid.getValue()
},
success : function(response) {
if(response.responseText == 'error'){
Ext.Msg.alert('失败');
}else{
ds.removeAll();
ds.addSorted([
new recordDef({
accountMoney:response.responseText})
]);
};
},
failure : function() {
Ext.Msg.show({
title : '错误提示',
msg : '发生错误!',
buttons : Ext.Msg.OK,
icon : Ext.Msg.ERROR
});
}
});