0

我正在尝试使用 Google Apps 脚本实现交互式页面。我已经在 UI 侧边栏中成功打开了一个文档,但是侧边栏的尺寸使其难以使用:

如何使嵌入式侧边栏页面更具吸引力/更易于使用?

我的谷歌文档在这里:https ://docs.google.com/document/d/17AtHwUSQdci-lh7BDvXeELcpZdXr27AryHlfagRR4Hg/edit

在此处输入图像描述 戈德格斯

      var TITLE = 'Sidebar Title';


      //Here is the code.gs code:
      function onOpen() {
        var ui = DocumentApp.getUi();
        ui.createMenu('==Sidebar==')
        .addItem('Show Document','SideBar3')
        .addToUi();
      };

      function SideBar3()
      {
        var ui = HtmlService.createHtmlOutputFromFile('ModeLessDialog').setTitle('Handler Communications');
         ui.setWidth(800)

        DocumentApp.getUi().showSidebar(ui);
      }

 //Here is the HTML file.  I called it ModeLessDialog.html
    <!DOCTYPE html>
    <html>
      <head>
        <base target="_top">
      </head>
      <body>
      <iframe  src="https://docs.google.com/document/d/1yb7knN941rdS-6okHQu_ZkvkgIaqXUIMioSAru9fzK4/" height="1000" width="90%"></iframe>

      </body>
    </html>

4

1 回答 1

1

您不能再更改 Google 插件中的侧边栏宽度。UI 之前有 setWidth() 方法,但现在已弃用。

在 Google 文档和表单中,侧边栏现在忽略 setWidth() 方法;它们不能从默认宽度 300 像素更改。

请参阅提及此更改的发行说明。

于 2018-06-27T08:04:14.597 回答