2016-01-29 94 views
0

我有一個ExtJS Web應用程序,其中有幾個hr標籤。問題是,無論我做什麼,線條都以邊框呈現 - 無論我指定隱藏的邊框樣式還是無邊框樣式 - 邊框仍顯示出來。無法擺脫ExtJS中hr標籤的邊框javascript頁面

這裏是我的代碼

var newForm = new Ext.form.FormPanel({ 
    header: false, 
    monitorValid: true, 
    height: 390, 
    width:800, 
    layout: new Ext.layout.FormLayout, 
    forceLayout: true, 
    padding: 5, 

    items: [ { 
       html: "<hr>", style: 'display: block;margin-top: 0.5em; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; border-style: hidden;' 
      } 
    ] 
    }); 

而且它產生如下:

enter image description here

有什麼建議?

在此先感謝

回答

0

有了這個difinition

items: [ 
    { 
     // Actually you add panel 
     // xtype: 'panel', 
     html: "<hr>", 
     style: 'display: block;margin-top: 0.5em; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; border-style: hidden;' 
    } 
] 

添加Ext.panel.PanelExt.form.FormPanel(因爲defaultType)項目。

當您應用style時,您實際上已將其添加到此Ext.panel.Panel DOM元素中,而不是您的<hr>元素。

你必須添加樣式<hr> difinition

html: "<hr style='display: block;margin-top: 0.5em; margin-bottom: 0.5em; margin-left: auto; margin-right: auto; border-style: hidden;'>" 

Here is simple fiddle

+0

其實我之前試過。具有諷刺意味的是,它拿走了一切,但邊界。 –

+0

嗯,你能不能更新提供的小提琴反映問題?也嘗試用'border:false'設置'panel'。 –

+0

邊界:錯誤的把戲工作。謝謝! –