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

前端 未结 1 664
走了就别回头了
走了就别回头了 2020-12-02 02:25

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

相关标签:
1条回答
  • 2020-12-02 03:03

    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
    0 讨论(0)
提交回复
热议问题