Ext.js form 表单提交问题

    var form = new Ext.form.FormPanel({
            labelAlign : 'right',
            border : false,
            bodyStyle : 'background-color: transparent;padding:5px',
            defaults : {
                xtype : 'textfield',
                anchor : '90%'
            },
            items : [{
                        name : 'rptId',
                        hidden : true
                    }, {
                        name :'parId',
                        hidden : true
                    },{
                        name : 'rptNm',
                        fieldLabel : '名称',
                        allowBlank : false
                    }, {
                        name : 'rptPath',
                        fieldLabel : '路径',
                        allowBlank : false,
                        xtype : 'textarea'
                    }, {
                        name : 'params',
                        width : 100,
                        fieldLabel : '参数',
                        xtype : 'multiCombo',
                        url : 'paramConfig!queryComboParams.action',
                        allowBlank : false
                    }, {
                        name : 'createAuth',
                        hidden : true
                    }, {
                        name : 'createDt',
                        hidden : true
                    }]
        });        
            
    var addCognosWin = new Ext.Window({
        title : '配置',
        width : 425,
        modal : true,
        closeAction : 'hide',
        items : form,
        buttons : [{
                    text : '提交',
                    handler : function() {
                    var node = tree1.getSelectionModel().getSelectedNodes()[0];
                    form.find('name','parId')[0].setValue(node.id);//此处不能用form.find('name','parId')[0].value = node.id;否则提交表单到后台不能获取到对象的parId值
                    console.log(form.find('name','parId')[0]);
                    BI.Util.submitForm({
                                formPanel : form,
                                url : 'cognosReport!addCognosReport.action',
                                maskEl : addCognosWin.el,
                                succ : function() {
                                    loadTree1();
                                    addCognosWin.hide();
                                }
                            });
                    }
                }, {
                    text : '取消',
                    handler : function() {
                        addCognosWin.hide();
                    }
                }]
    });        

 

posted @ 2014-07-26 17:20  huazhiliange  阅读(819)  评论(0编辑  收藏  举报