Appmaker输入表单,根据先前的下拉选项更改选项 [英] Appmaker Input Form, change options based on earlier dropdown choices

查看:44
本文介绍了Appmaker输入表单,根据先前的下拉选项更改选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设的:

说我要某人点蛋糕,他们选择香草或巧克力,然后他们必须选择糖霜

Say i'm having someone order a cake and they choose vanilla or chocolate, and then they have to choose a frosting

if vanilla: strawberry or buttercream   

if chocolate: mocha, dark chocolate or buttercream.

现在,数据模型中的结霜值可以接受所有四个选项,因此所有四个选项都显示在下拉列表中.

Right now the frosting value in the data model can accept all four options, so all four show up in the dropdown.

a)有没有办法在选择第一个下拉菜单后更改第二个下拉菜单的绑定?

a) is there a way to change the binding for the second dropdown after the first is chosen?

推荐答案

我猜您在数据源中设置了下拉菜单"possible value"选项,而这些字段只是表中的字符串字段.

Im guessing you set the dropdown "possible value" options in the data source and you have those fields as just string fields in your table.

快速而肮脏的方法是转到Cake下拉菜单,然后在属性编辑器">事件">"OnValueChange"中选择自定义操作"并使用此代码

the quick and dirty way to do this is go to the Cake drop down and on the Property Editor>Events>OnValueChange select Custom Action and use this Code

if(widget.value==="Vanilla"){
   widget.root.descendants.Field.options = ['Strawberry','Buttercream'];
}else if (widget.value === "Chocolate"){
  widget.root.descendants.Field.options = ['Mocha','Dark Chocolate','Buttercream'];
}

此处的字段"被替换为您的糖霜下拉框的名称

"Field" here is replaced with the name of the dropdown box for your frostings

还转到frostings下拉列表的属性编辑器,然后删除其中的options字段中的所有内容.

also go to the property editor of the frostings dropdown and delete everything in the options field there.

这篇关于Appmaker输入表单,根据先前的下拉选项更改选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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