2016-12-28 63 views
1

對於Webix TabView的,我使用類似的配置,以執行以下操作: http://webix.com/snippet/cdb211fd如何爲tabview設置適當的大小?

view: "tabview", 
    cells: [ 
    { 
     header: "Tab 2", 
     body: { 
     rows: [   
      { 
      cols: [ 
       { view: "button" }, 
       { view: "button" }    
      ] 
      }, 
      { 
      view: "datatable" 
      } 
     ] 
     } 
    }, /* another with the same config, but different number of buttons */ 
    ] 

最初,所有是OK,但是如果用戶切換到另一個選項卡,它會擠壓到按鈕的寬度,而我預計tabview將適合屏幕。有沒有解決方法或我做錯了什麼?

回答

0

我通常使用一個多視圖與tabbar,所以我沒有遇到這個問題。 看來,webix正在調整tabview與當前活動單元格的寬度。 您示例中的一個簡單解決方案是將寬度配置值放入tabview實例。 我想,在這裏:http://webix.com/snippet/88e79fc7(我用的寬度:「100%」,使TabView的佔據其父視圖的整個寬度

0

有時webix需要空的空間要明確你後添加{}元素「。 。工具欄」。按鈕

{ 
    padding:10, 
    cols: [ 
     { view: "button", value: "Refresh", width: 150 }, 
     { view: "button", value: "Serialize", width: 150 }, 
     {} 
    ] 
}, 

一個更好的辦法是使用 「工具欄」 窗口小部件用於此目的

更新片段:http://webix.com/snippet/fab21b2e