ext FormPanel的显示问题

开始摸索着将ext整合到项目当中,点击超连接打开的FormPanel老是问题不断,主要问题有二:

1,显示不正常。点击前三次,出现不同的效果,当点击次数>=3以后,显示正常。三次显示效果如下:

2,在firefox下第一次,第二次点击都没效果,第三次点击才显示。并且,firefox下鼠标无法进入输入框。相当于输入框都禁用了。

相关代码如下:

 

 //增加form,window开始
      Ext.get("add").on('click',function() {
      var winlist;
      if(!winlist){  
                   var innerForm=new Ext.FormPanel({  
                    labelWidth: 125, // label settings here cascade unless overridden  
                    url:'<%=basePath%>add.ext',  
                    frame:true,  
                    // title: 'Simple Form',  
                    bodyStyle:'padding:5px 5px 0',  
                    width: 450,  
                    defaults: {width: 230},  
                    layout:'form',  
                    defaultType: 'textfield',  
                    items: [{  
                             fieldLabel: '姓名',  
                             name: 'name',  
                             allowBlank:false 
                           },{  
                             inputType:'password',
                             fieldLabel: '密码',  
                             name: 'password', 
                             allowBlank:false
                           },{
                             xtype:'combo',
                             store: new Ext.data.SimpleStore({

                                          fields: ["retrunValue", "displayText"],
                                          data: [[1,'男'],[2,'女']]

                                         }),

                                         valueField :"retrunValue",
                                         displayField: "displayText",
                                         mode: 'local',

                                         forceSelection: true,

                                         blankText:'请选择性别',

                                         emptyText:'选择性别',

                                         hiddenName:'sex',

                                         editable: false,

                                         triggerAction: 'all',

                                         allowBlank:false,
                                         fieldLabel: '性别',
                                         name: 'sex',
                                         anchor:'90%'},
                                         {  
                             fieldLabel: '电子邮件',  
                             name: 'email',
                             allowBlank:false,
                             vtype:'email'  
                           },  
                          
                           {  
                             fieldLabel: '手机',  
                             name: 'tel',
                             allowBlank:false
                            //vtype:'email'  
                           }, {  
                             fieldLabel: '电话',  
                             name: 'phone',
                             allowBlank:false
                            //vtype:'email'  
                           } , {  
                             fieldLabel: '联系地址',  
                             name: 'address',
                             allowBlank:false
                            //vtype:'email'  
                           }    
                          ]  
                    });  
                    winlist=new Ext.Window({  
                        title:'信息添加',
                        layout:'fit',  
                        width:450,  
                        height:400,  
                        closeAction:'hide',  
                        plain: true,  
                        buttonAlign:'center',  
                        buttons: [{  
                           text:'保存',  
                           scope:'DataType',  
                           type:'submit',  
                           disabled:false,  
                           handler:function(){  
                           innerForm.getForm().submit({  
                                method:'POST',  
                                waitMsg:'保存中,请稍候.....',   
                                      success:function(form,action){   
                                     grid.getView().refresh();  
                                    form.reset();  
                                    Ext.Msg.alert('信息增加','保存成功!');  
                                    this.disabled=false;   
                                    winlist.hide();   
                                                             

                           },  
                                failure:function(){  
                                    Ext.Msg.alert('信息增加','保存失败!');  
                                    this.disabled=false;  
                                }  
                             }  
                            );  
                           }  
                              },{  
                           text: '关闭',  
                           handler: function(){  
                              winlist.hide();  
                               }  
                          },{  
                            text:'重置',  
                            handler:function(){  
                                innerForm.getForm().reset();  
                            }  
                          }  
                          ]  
                    });  
                    winlist.add(innerForm);  
                      
                }  
                winlist.show(this);
                 }); 

由于刚刚接触ext,上面的代码也是借鉴拼凑过来的。出先这样的问题,是在不知道如何解决。

你可能感兴趣的:(ext,firefox)