本文介绍了如何自定义带有消息的Snackbar或Notification对话框之类的弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用程序中包含一项功能,该功能可以检查用户上传的Google表格中的列值,并验证它们是否正确.如果有任何不正确的值,则会出现诸如Snackbar或通知"对话框之类的弹出窗口,列出不正确的值.如果没有不正确的值,则不会出现任何弹出窗口.如何根据情况显示具有不同值的弹出窗口?有没有一种方法可以直接从ServerScript中显示唯一的弹出窗口,而不必创建单独的页面?非常感谢你!

I am trying to include a feature in my app that examines the values of a column in a user-uploaded Google sheet and verifies whether they are correct or not. If there are any incorrect values, a popup like Snackbar or Notification dialog will appear listing the incorrect values. If there are no incorrect values, no popup will appear. How do you display a popup with different values depending on the situation? Is there a way to display unique popups directly from the ServerScript without having to create separate pages? Thank you very much!

推荐答案

您可以通过与Snackbar的子窗口小部件直接交互或将它们绑定到自定义属性:

You can do it either by direct interaction with Snackbar's children widgets or by binding them to Custom Properties:

// option 1
app.popups.Snackbar.descendants.SnackbarText.text = message;

// option 2
app.popups.Snackbar.properties.Text = message;

app.popups.Snackbar.visible = true;

您可以在此处看到首选实施示例- https://developers.google.com /appmaker/samples/jdbc/

You can see first option implementation sample here - https://developers.google.com/appmaker/samples/jdbc/

这篇关于如何自定义带有消息的Snackbar或Notification对话框之类的弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:56