Anybody else having trouble with the setWidth function? The example here is "300", but if you change the number, the sidebar is the same width. I've tried a few times on a clean spreadsheet.
https://developers.google.com/apps-script/guides/dialogs#custom_sidebars
Click the 'My New Menu' and select the menu item 'My sidebar 1' to display the sidebar. Now your custom sidebar will show up at the right-hand side of your google sheet with the text and the button we added (as shown below). When you click the button, the sidebar will be closed.
A sidebar can display an HTML service user interface inside a Google Docs, Forms, Slides, or Sheets editor. Sidebars do not suspend the server-side script while the dialog is open. The client-side component can make asynchronous calls to the server-side script using the google.
Google Scripts now ignore the setWidth() method and the sidebar width is now fixed at 300px. From the release notes:
In Google Docs and Forms, sidebars now ignore the setWidth() method; they cannot be changed from the default width of 300px. This change was applied to the new version of Sheets in the previous week's release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With