extjs学习笔记

来源:互联网 发布:身份证app扫描软件 编辑:程序博客网 时间:2024/06/07 05:53


1、extjs提交方式
ajax:
              Ext.Ajax.request({
               url:'valid.action',
               params:{'user.username':name,'user.password':pas},
               success:function(response){
                var result = Ext.decode(response.responseText);
                alert(result.user.username + "登录成功!");
                window.location.href="login.action";
// window.location.href="http://www.163.com";
               },
               failure:function(response){
                alert("账户名或密码错误,请重新输入!");
// var result = Ext.decode(response.responseText);
// failFn(result);
               }
              });
             
             
一般:
      fn:function(btnId){
      switch(btnId){
       case "ok":
        form.submit({
         url : 'addStu.action',
         params:{'student.num':num,'student.name':name},
                        success: function(form, action) {
                           Ext.Msg.alert('Success', '保存成功!');
                           addWindow.close();
// ios_otherIncomeStore.load(
// {params:{'otherIncome.cashNumber': num
// }});
                        },
                        failure: function(form, action) {
                           Ext.Msg.alert('Error', '保存失败!');
                           addWindow.close();
                        }
                    });
        break;
       case "no":
        break;
      }
2、点击保存按钮总是提示保存失败
在action中添加boolean success属性,并在成功中给其赋值为true,失败中赋值为false
3、查询时不能正常查询到数据
在action中添加boolean success属性,并在成功中给其赋值为true,失败中赋值为false
4、使用store加载数据如果加载不上,可以先通过store.load()方法手动加载
5、复选框不起作用,model中该列的 type不应该是int,默认为空即可  
1、extjs提交方式
ajax:
              Ext.Ajax.request({
               url:'valid.action',
               params:{'user.username':name,'user.password':pas},
               success:function(response){
                var result = Ext.decode(response.responseText);
                alert(result.user.username + "登录成功!");
                window.location.href="login.action";
// window.location.href="http://www.163.com";
               },
               failure:function(response){
                alert("账户名或密码错误,请重新输入!");
// var result = Ext.decode(response.responseText);
// failFn(result);
               }
              });
             
             
一般:
      fn:function(btnId){
      switch(btnId){
       case "ok":
        form.submit({
         url : 'addStu.action',
         params:{'student.num':num,'student.name':name},
                        success: function(form, action) {
                           Ext.Msg.alert('Success', '保存成功!');
                           addWindow.close();
// ios_otherIncomeStore.load(
// {params:{'otherIncome.cashNumber': num
// }});
                        },
                        failure: function(form, action) {
                           Ext.Msg.alert('Error', '保存失败!');
                           addWindow.close();
                        }
                    });
        break;
       case "no":
        break;
      }
2、点击保存按钮总是提示保存失败
在action中添加boolean success属性,并在成功中给其赋值为true,失败中赋值为false
3、查询时不能正常查询到数据
在action中添加boolean success属性,并在成功中给其赋值为true,失败中赋值为false
4、使用store加载数据如果加载不上,可以先通过store.load()方法手动加载
5、复选框不起作用,model中该列的 type不应该是int,默认为空即可  
0 0
原创粉丝点击