如何使用多个Google文件选取器处理回电 [英] How do I handle the call back using multiple Google File Picker
问题描述
如果我在一个页面上有多个Google Drive File Pickers,我该如何处理回调以确保数据传递到正确的部分?
我基本上有一个列出的项目数量,每个项目都有一个选择文件按钮链接到文件选取器。所有的例子只是将数据传回到同一个地方,但我需要这个对于每个请求都是不同的。
我基本上有相同的代码包含在文档中:
如果您想将参数传递给回调函数,请使用匿名函数:
.setCallback(function(data){pickerCallback(data,MYPICKERID)})
If I have multiple Google Drive File Pickers on one page how do I handle the callback to ensure the data is passed to the correct section?
I basically have a number of items listed, each Item has a select a file button linked to the file picker. All the examples just pass the data back to the same place but I need this to be different for each request.
I'm basically have the same code that is included in the docs:
https://developers.google.com/apps-script/guides/dialogs#file-open_dialogs
How can I do this?
As Eric said use the setCallback method.
If you want to pass a parameter to a callback use an anonymous function:
.setCallback(function(data){pickerCallback(data,"MYPICKERID")})
这篇关于如何使用多个Google文件选取器处理回电的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!