var Panel = new Ext.form.FormPanel({
defaults: {
xtype: 'textfield',
allowBlank: false, width: 300
},
items: [{ name: 's',
id: 's',
fieldLabel: '备注',
value: s
}],
buttons: [{
text: "确定",
tabIndex: 1,
iconCls: 'save',
handler: onSaveEnvirrecord
}, {
text: "取消",
tabIndex: 2,
iconCls: 'close',
handler: function () {
win.close();
}
}
]
});
function onSaveEnvirrecord() {
if (!Panel.form.isValid()) { onError("字段值不合法,未能保存!");
return;
}
var s = Panel.form.findField('s').getValue(); Ext.Ajax.request({
url: 'core/WebService.asmx/SaveEnvirrcord',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
method: 'POST',
jsonData: {
s: s
},
sucess: function (response) { var res = Ext.JSON.decode(response.responseText).d;
if (res == "") { Ext.MessageBox.show({
title: "消息",
msg: "保存成功!",
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
win.close();
}
else {
onError(res);
}
},
failure: function (response) { onError(response.responseText); } }); }
function onError(error) {
Ext.MessageBox.show({
title: '错误',
msg: error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
defaults: {
xtype: 'textfield',
allowBlank: false, width: 300
},
items: [{ name: 's',
id: 's',
fieldLabel: '备注',
value: s
}],
buttons: [{
text: "确定",
tabIndex: 1,
iconCls: 'save',
handler: onSaveEnvirrecord
}, {
text: "取消",
tabIndex: 2,
iconCls: 'close',
handler: function () {
win.close();
}
}
]
});
function onSaveEnvirrecord() {
if (!Panel.form.isValid()) { onError("字段值不合法,未能保存!");
return;
}
var s = Panel.form.findField('s').getValue(); Ext.Ajax.request({
url: 'core/WebService.asmx/SaveEnvirrcord',
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
method: 'POST',
jsonData: {
s: s
},
sucess: function (response) { var res = Ext.JSON.decode(response.responseText).d;
if (res == "") { Ext.MessageBox.show({
title: "消息",
msg: "保存成功!",
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
win.close();
}
else {
onError(res);
}
},
failure: function (response) { onError(response.responseText); } }); }
function onError(error) {
Ext.MessageBox.show({
title: '错误',
msg: error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货