前端之家收集整理的这篇文章主要介绍了
Extjs用ajax提交表单四种方式,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
-
-
-
-
-
-
-
-
-
-
-
- functionsaveUser_ajaxSubmit1(){
- Ext.Ajax.request({
- url:'user_save.action',
- method:'post',
- params:{
- userName:document.getElementById('userName').value,248)"> password:document.getElementById('password').value
- },
- success:function(response,options){
- varo=Ext.util.JSON.decode(response.responseText);
- alert(o.msg);
- failure:function(){
- }
- });
-
-
-
-
-
-
-
- functionsaveUser_ajaxSubmit2(){
- Ext.Ajax.request({
- url:'user_save.action',248)"> method:'post',108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> form:'userForm',
-
-
-
- functionsaveUser_ajaxSubmit3(){
-
- varformPanel=newExt.FormPanel({
- labelWidth:75,108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> frame:true,248)"> bodyStyle:'padding:5px5px0',108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> width:350,248)"> defaults:{
- 230
- },
- defaultType:'textfield',248)"> items:[{
- fieldLabel:'用户名',248)"> name:'userName',108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> allowBlank:false
- fieldLabel:'密码',248)"> name:'password'
- }]
-
- varwin=newExt.Window({
- title:'添加用户',248)"> layout:'fit',0); margin:0px; padding:0px; border:none; background-color:inherit">500,248)"> height:300,108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> closeAction:'close',248)"> closable:false,108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> plain:true,248)"> items:formPanel,108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> buttons:[{
- text:'确定',108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> handler:function(){
- varform=formPanel.getForm();
- varuserName=form.findField('userName').getValue().trim();
- varpassword=form.findField('password').getValue().trim();
- if(!userName){
- alert('用户名不能为空');
- return;
- }
- if(!password){
- alert('密码不能为空');
- form.submit({
- waitTitle:'请稍后...',108); line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important; list-style-position:outside!important"> waitMsg:'正在保存用户信息,请稍后...',248)"> success:function(form,action){
- alert(action.result.msg);
- failure:function(form,action){
- alert(action.result.msg);
- text:'取消',248)"> handler:function(){
- win.close();
- win.show();
-
-
-
- functionsaveUser_ajaxSubmit4(){
- newExt.form.BasicForm('userForm').submit({
- }
原文链接:https://www.f2er.com/ajax/162825.html