定义了一个panel之后,为panel添加一项,但是添加了之后显示不出来。

解决方案 »

  1.   

    自己参照一下看看,有问题再发上来:Ext.onReady(function(){
        var SendCmd = new Ext.FormPanel({
                    aotoHeight:true,
                    buttonAlign:'center',
                    border:false,
                    bodyStyle:'padding: 10px 10px 10px 20px;',
                    labelWidth:2,
                    defaults:{
                            anchor:'95%',
                            allowBlank:false,
                            msgTarget:'side'
                    },
                    items:[{
                                xtype:'textarea',
                                id:'Result',
                                name:'Result',
                                height:200,
                                readOnly:true,
                                allowBlank:true
                             }, {
                                 xtype:'textfield',
                                 emptyText : '请输入...',
                                 name:"Task",
                                 id:"Task",
                                 listeners:{'specialkey':function(_field,_e){
                                    if (_e.getKey() == _e.ENTER){
                                        var str = Ext.getCmp('Result').getValue()+'\r\n'+Ext.getCmp('Task').getValue();
                                        Ext.getCmp('Result').setValue(str);
                                        document.all.Result.scrollTop=document.all.Result.scrollHeight;
                                    }
                                }}
                             }]
                });
        var win=new Ext.Window({
            layout:'fit',
                    title:"test",
            width:620,
            height:350,
            constrain: true,
            resizable:false,
            collapsible:true,
                    closable:true,
            items:SendCmd
        });
        win.show();
    });
      

  2.   

    没有代码啊。。
    如果是动态添加的话,需要doLayout()
    帖出代码来看看吧