2014-09-02 64 views
0

我無法像在ExtJS 4中那樣設置文本字段寬度。設置不同類型的佈局(錨點,列)或甚至硬編碼寬度作爲文本字段配置不起作用。文本字段寬度保持不變。該面板在窗口中呈現。ExtJs 5無法設置文本字段寬度

 

    Ext.define('Dash.view.card.CardForm',{ 
     extend:'Ext.panel.Panel', 
     layout:{ 
      type:'hbox', 
      align:'stretch' 
     }, 
     frame:false, 
     bodyPadding:25, 
     initComponent:function() { 


      this.items = [{ 
       xtype:'fieldset', 
       title:'Form', 
       layout:'anchor', 
       flex:2, 
       items:[{ 
        xtype:'textfield', 
        fieldLabel:'Name', 
        name:'name', 
        anchor:'100%' 
       },{ 
        xtype:'textfield', 
        fieldLabel:'SET', 
        name:'set', 
        anchor:'100%' 
       },{ 
        xtype:'textfield', 
        fieldLabel:'Url', 
        name:'url', 
        anchor:'100%' 

       },{ 
        xtype:'textfield', 
        fieldLabel:'Price', 
        name:'price', 
        anchor:'100%' 
       }] 
      },{ 
       xtype:'fieldset', 
       title:'Card Preview', 
       flex:1, 
       items:[{ 
        xtype:'image', 
        name:'preview' 
       }] 
      }]; 

      this.callParent(arguments); 
     } 
    }); 

使用鉻檢查我注意到呈現的div有適當的寬度,但它的子html輸入沒有寬度。

回答

0

我從應用程序啓動與boostrap切換到標準腳本包含,並忘記包含正確的css文件。在添加ext-theme-crisp-all.css文件後,可以確保一切正常。