ดึงชื่อชีตมาสร้าง Drop down menu สำหรับ Web Apps
HTML Code
<div align = 'center'style='margin-top:100px'><span> Country </span><select id="menuList"><option selected value = ''>Select item</option></select><span id="listValue" ></span></div>
Javascript Code
<script>window.addEventListener('load', function() {option_menu()})const option_menu = () => {google.script.run.withSuccessHandler(function(output){var menu_Select = document.getElementById("menuList");var option = document.createElement("option");output.forEach(function(item) {var option = document.createElement("option");option.value = item[0];option.text = item[0];menu_Select.appendChild(option);});}).getSheetNames();}</script>
Code.gs
function getSheetNames() {var output = new Array()var ss = SpreadsheetApp.getActiveSpreadsheet();var sheets = ss.getSheets();for (var i=0 ; i < sheets.length ; i++) {output.push( [ sheets[i].getName() ] )Logger.log(output)return output}
ที่มาครูสมชายคัดมาจาก : {getButton} $text={อ้างอิงที่มา} $icon={link} $color={red}
>>>TRY TO CHECK OUT , IF ANY ERROR FOUND. PLEASE LET ME KNOW BY COMMENT.
I'LL TRY MY LEVEL BEST TO FIX THE PROBLEM.
THANKS FOR VISITING thumariya.blogspot
Have a nice day!
-------------------------- -------------------------
>>>ลองตรวจสอบหากพบข้อผิดพลาด โปรดแจ้งให้เราทราบโดยแสดงความคิดเห็น
ฉันจะพยายามระดับของฉันให้ดีที่สุดเพื่อแก้ไขปัญหา
ขอบคุณสำหรับการเยี่ยมชม thumariya.blogspot
ขอให้เป็นวันที่ดี!
-------------------------- -------------------------
{fullWidth}