button click is only working on Windows & not working on Android mobile sheet

蓝咒 提交于 2019-12-11 05:14:37

问题


I have created an image button in Google spreadsheet and have assigned function, to perform some action. But this button click is only working on windows and not working on Android mobile sheet or mobile browser. what is a workaround for this issue?


回答1:


Workaround is to use checkboxes(say, in F1) instead of buttons/Images. Then hook your function, that is supposed to run on button click to onEdit() function.

Sample script:

function onEdit(e){
  const rg = e.range;
  if(rg.getA1Notation() === "F1" && rg.isChecked() && rg.getSheet().getName() === "Sheet1"){
    callFunctionAttachedToImage();
    rg.uncheck();
  }
}

References:

  • Class Range
  • Event Objects


来源:https://stackoverflow.com/questions/57840757/button-click-is-only-working-on-windows-not-working-on-android-mobile-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!