2012-08-13 46 views
1

我似乎無法使SplitLayoutPanel顯示它的子元素。 GAS似乎支持這個課程,因爲它在文檔中有所提及。顯示SplitLayoutPanel和它的子元素

https://developers.google.com/apps-script/class_splitlayoutpanel

這裏是我的代碼的嘗試。任何建議將不勝感激。我的假設是這給用戶,他們可以通過拖動來調整面板(這是理想的東西我要去爲我分路器。有更多的細節右側面板的左側面板。

 function doGet(e) { 
    var app = UiApp.createApplication(); 
    //code goes here    

    var mainPanel = app.createSplitLayoutPanel().setId('mainPanel') 
    .setVisible(true); 
    app.add(mainPanel); 

    var eastPanel = app.createVerticalPanel().setId('eastPanel'); 
    eastPanel.add(app.createLabel('eastPanel loaded')); 
    mainPanel.addEast(eastPanel, 500); 

    var westPanel = app.createVerticalPanel().setId('westPanel'); 
    westPanel.add(app.createLabel('westPanel loaded')); 
    mainPanel.addWest(westPanel, 500); 


    return app; 
} 

什麼我錯過?

回答

1

單行mainPanel.setSize('100%', '100%');被錯過。下面的代碼工作。@ megabyte1024

function doGet(e) { 
    var app = UiApp.createApplication(); 
    //code goes here 

    var mainPanel = app.createSplitLayoutPanel().setId('mainPanel') 
    .setVisible(true); 
    mainPanel.setSize('100%', '100%'); 
    app.add(mainPanel); 

    var eastPanel = app.createVerticalPanel().setId('eastPanel'); 
    eastPanel.add(app.createLabel('eastPanel loaded')); 
    mainPanel.addEast(eastPanel, 500); 

    var westPanel = app.createVerticalPanel().setId('westPanel'); 
    westPanel.add(app.createLabel('westPanel loaded')); 
    mainPanel.addWest(westPanel, 500); 

    return app; 
} 
+0

感謝。這是缺少的環節......我希望的文件是在這些項目有點更清晰。欣賞幫助。 – jrad 2012-08-13 20:53:54