2016-09-22 9 views
-2

dialog in a Google Spreadsheetの幅を設定する必要があります。function openDialog()幅と高さの設定Googleスプレッドシート

これまでのところ、私のコードは次のとおりです。

// Use this code for Google Docs, Forms, or new Sheets. 
function onOpen() { 
    SpreadsheetApp.getUi() // Or DocumentApp or FormApp. 
     .createMenu('Cadastro') 
     .addItem('Open', 'openDialog') 
     .addToUi(); 
} 

function openDialog() { 
    var html = HtmlService.createHtmlOutputFromFile('index'); 
    SpreadsheetApp.getUi() // Or DocumentApp or FormApp. 
     .showModalDialog(html, 'Dialog title'); 
}`enter code here` 

答えて

0

これはあなたの高さと幅を設定します。もちろん

function openDialog() { 
    var html = HtmlService.createHtmlOutputFromFile('index') 
    .setHeight(100) 
    .setWidth(100); 
    SpreadsheetApp.getUi() // Or DocumentApp or FormApp 
    .showModalDialog(html, 'Dialog title') 
    }//`enter code here` 

あなたはまた、同様にスクリプトエディタにindex.htmlファイルを追加する必要があります。ありがとうございました

Hello, world! <input type="button" value="Close" onclick="google.script.host.close()" /> 
+0

!完璧に働いた;) –

+0

それはあなたのために働いた場合、あなたは答えを承認していただけますか?ありがとう。 –

関連する問題