2012-09-20 15 views
2

我需要一頂bar.I編碼這樣的下一行中的一個組成部分,使用問題在IE7 TBAR行分隔符ExtJS的

tbar: [{ 
    xtype: 'textfield' 
    id:'fname' 
},'-',{ 
    xtype: 'textfield' 
    ,id: 'lname' 
},'<row>',{ 
    xtype: 'textfield' 
    ,id:'mob' 
}] 

這是在瀏覽器,Firefox做工精細和IE7瀏覽器+,但這是不工作在ie7.can有人請糾正我的代碼。

回答

0

您在xtype:'textfield'之後沒有逗號。

IE7在JavaScript中對逗號非常敏感。

tbar: [{ 
    xtype: 'textfield' 
    ,id:'fname' 
},'-',{ 
    xtype: 'textfield' 
    ,id: 'lname' 
},'<row>',{ 
    xtype: 'textfield' 
    ,id:'mob' 
}] 

編輯:我做了這個小提琴,它工作在所有的瀏覽器:

http://jsfiddle.net/MG3fS/3/

+0

我試過你的建議仍然不起作用 –

+0

我編輯了我的例子。 –

0

怎麼樣一個非常原始的方法嗎?

tbar : { 
    layout : 'auto', // im not sure why 'vbox' does not work here 
    width: 200, 
    items : [{ 
     xtype: 'container', 
     layout: 'hbox', 
     items : [{ 
      xtype: 'textfield', 
      id:'fname' 
     }, { 
      xtype: 'container', 
      html: '-', 
      width: 5 
     }, { 
      xtype: 'textfield', 
      id: 'lname' 
     }] 
    }, { 
     xtype: 'textfield', 
     id : 'mob' 
    }] 
} 
+0

我收到以下錯誤「使用此方法時無法讀取未定義的屬性'ownerCt'」。 –

+0

對不起,我似乎在最後一個組件的cfg中留下了一個錯字。 xtype是'texfield'而不是'textfield'。編輯:似乎也有不必要的逗號。 現在修正(儘管我不確定它是否導致你的錯誤) –