是否可以在Google App Maker中应用条件格式? [英] Is it possible to apply conditional formatting in Google App Maker?

查看:49
本文介绍了是否可以在Google App Maker中应用条件格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google App Maker中有一个表,我想知道是否可以将条件格式应用于表中的行.

I have a table in Google App Maker, I am wondering is it possible to apply conditional formatting to rows of the table.

示例:如果下拉菜单的值为是",则将该行的背景色设置为红色.

Example: If the value of a drop down is "Yes" set that row's background colour to be red.

与此相关的文档一如既往地无用,无法找到与此相关的任何问题.

The documentation regarding this is useless as always and wasn't able to find any questions regarding this.

图片:

显示为灰色的图片:

推荐答案

秘密就在您的绑定中.如果您希望保留常规分配的样式,例如"app-ListTableRow"和"hoverAncestor",请执行以下操作:

The secret is in your bindings. If you wish to retain the regular assigned styles like 'app-ListTableRow' and 'hoverAncestor' then do the following:

例如,在样式编辑器中添加一个类,例如:

Add a class in your Style Editor like this for example:

.red {
  background: linear-gradient(to bottom, darkred, red);
}

在表格的显示"行上-样式输入以下绑定:

On your table row 'Display' - styles enter the following binding:

@datasource.item.CertificateisRequired === 'Yes' ? ['red','app-ListTableRow','hoverAncestor'] : ['app-ListTableRow','hoverAncestor']

那样就可以了.

如果每行都有一个下拉菜单,建议您将其称为"CertificateisRequired",而不要保留默认名称(如"DropDown1")或任何App Maker为其分配的名称.然后将显示-样式"行中的绑定调整为:

If you have a dropdown in each row I would suggest to call it 'CertificateisRequired' instead of leaving a default name like 'DropDown1' or whatever App Maker assigns to it. Then adjust the binding in the row Display - styles to:

@widget.descendants.CertificateisRequired.value === 'Yes' ? ['red','app-ListTableRow','hoverAncestor'] : ['app-ListTableRow','hoverAncestor']

这篇关于是否可以在Google App Maker中应用条件格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆