โœจevent: onEdit

/**
 * onOpen()
 */
function onOpen() {
  // app UI
  var ui = SpreadsheetApp.getUi();
  
  // โ™ฅ ่‡ช่ฃฝๅทฅๅ…ท
  ui.createMenu('๐Ÿงฐ ๅทฅๅ…ท็ฎฑ')
    .addItem('โถ ๅŽŸๅง‹ๅ ฑ่กจ โž  ็”Ÿๆˆ่ณ‡ๆ–™', 'init')        
    .addToUi();
}

/**
 * onEdit(e)
 * triggered when editing the spreadsheet.
 * @param {Event} e The onEdit event.
 */
function onEdit(e) {

  // โญ๏ธ edited cell
  var range = e.range;
  let rngGrade = App.range.byName('Grade');

  // ไธๆ˜ฏใ€Œ้ซ˜ไธ€ใ€้ซ˜ไบŒใ€้ซ˜ไธ‰ใ€้‚ฃไธ€ๆ ผ๏ผŒๅฐฑ่ซ‹ๅ›žใ€‚
  if (!App.isSameRange(range, rngGrade)) return;
  App.updateCurrentClasses();
}

Last updated