google-app-maker - 服务器端更改后客户端重新加载记录
问题描述
在服务器脚本中调用 app.saveRecords() 后,我必须在任何客户端页面上点击刷新(在 Chrome 中)以重新加载数据源。在服务器上的 saveRecords() 之后我可以调用什么来强制客户端刷新吗?
解决方案
此客户端脚本代码有效:
function addCont(widget) {
var holder = widget.root.descendants;
var con = {
barcode: holder.Barcode.value,
part: holder.Part.value,
location: holder.Location.value
};
google.script.run.withSuccessHandler(function(result) {
console.log("Container Added");
// This forces the other pages to reload after the server adds the record
widget.root.datasource.load();
clearAddCont(widget);
}).addContainer(con);
}
推荐阅读
- laravel - 如何在 Laravel 项目中处理不同的兄弟对象(不是模型)
- r - 如何对向量中的数字进行舍入以仅在 R 中显示必要的小数?
- c# - 无法将连接字符串 C# 中用户名中的反斜杠限制为单斜杠
- r - 使用填充美学时,在 ggplot2 中的条上添加文本
- python - 如何在不使用 time.sleep() 的情况下每秒将值附加到列表中?
- reactjs - 如何向剑道反应组件添加样式或 className 属性,例如
ETC。? - angular - Angular 9. 行扩展时的 ngx-datatable 延迟
- mysql - Mysql避免插入选择中的重复输入错误
- python - Numpy:索引 i < j 的一维数组的总和
- angular - 使用 Express 服务器提供服务时未加载 Angular 脚本