ext4我没用过,不小得params:Ext.JSON.encode(form.getValues()) 这句话有问题没有。反正3不行。另外注意参数名的大小写!

解决方案 »

  1.   

    workOrders 有数据不? 提交不上,有错误不
      

  2.   

    要是换成非ajax提交就会报错
    buttons: [ {
            text: '增加',
            formBind: true, //only enabled once the form is valid
            disabled: true,
            handler: function() {
                var form = this.up('form').getForm();
                var window =this.up('window');
                if (form.isValid()) {
                    form.submit({
                        success: function(form, action) {
                           Ext.Msg.alert('增加成功', action.result.msg);
                           window.close();
                           store.load();
                        },
                        failure: function(form, action) {
                            Ext.Msg.alert('增加失败', action.result.msg);
                        }
                    });
                }
            }
        },{
            text: '取消',
            handler: function() {
                this.up('window').close();
            }
        }]
      

  3.   

    改了一下,数据存储不进去数据,请求服务器失败改的Extjs代码为//------------------添加按钮事件----------------------------------------------
        gdgl_add_Item:function(button){
         var cmpanel=button.up('globalStatisticsView');
         var store = cmpanel.getStore();
         var myWindow = Ext.create('Ext.window.Window',{
         title:'增加联系人',
         height: 300,
        width: 450,
        id:'add_window',
        layout: 'form',
        modal:true,
        items: {  // Let's put an empty grid in just to illustrate fit layout
            xtype: 'form',
            border: false,
            url:'gdgl/addmanagers',
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },
            defaultType: 'textfield',
        items: [{
            fieldLabel: '故障时间',
            name: 'failuretime',
            xtype: 'datefield',
             margin:10,
             allowBlank:false
        },{
            fieldLabel: '故障地点',
            name: 'failureaddress',
            margin:10,
            allowBlank: false
        },{
            fieldLabel: '维修时间',
            name: 'repairtime',
            xtype: 'datefield',
            margin:10,
            allowBlank: true
        },{
            fieldLabel: '维修人',
            margin:10,
            name: 'maintenanceman',
            allowBlank: true
        },{
            fieldLabel: '完成情况',
            margin:10,
            name: 'completion',
            allowBlank: true
        },{
            fieldLabel: '故障内容',
            margin:10,
            name: 'failurecontent',
            allowBlank: true
        }],
       buttons: [ {
            text: '增加',
            formBind: true, //only enabled once the form is valid
            disabled: true,
            handler: function() {
                var form = this.up('form').getForm();
                var window =this.up('window');
                if (form.isValid()) {
                    form.submit({
                        success: function(form, action) {
                           Ext.Msg.alert('增加成功', action.result.msg);
                           window.close();
                           store.load();
                        },
                        failure: function(form, action) {
                            Ext.Msg.alert('增加失败', action.result.msg);
                        }
                    });
                }
            }
        },{
            text: '取消',
            handler: function() {
                this.up('window').close();
            }
        }]
        }
         });
         myWindow.show();
         },
    后台没有报错。就是老是插不进去数据,firefox还老是报错
      

  4.   

    我把数据库的里字段的类型改了,只要string类型就可以了。增删查改都可以了,难道我传过去的数据格式问题?
      

  5.   

    楼主这么提交吗?感觉别扭啊。xxx.getForm().submit({.....})不就可以提交吗
      

  6.   

    服务端只认是比较简单的数据类型,像时间类型是不会认识的,所以在时间字段的set方法里面建议重新格式化一下