为了账号安全,请及时绑定邮箱和手机立即绑定

在数据网格中的 form.io 中使用条件

在数据网格中的 form.io 中使用条件

吃鸡游戏 2022-12-22 11:56:59
我刚开始弄乱 form.io 并且有点卡住了。我正在尝试在数据网格的每一行中创建一些条件。例如,如果选择了等于“payIn”的单选按钮,则同一行中应出现另一个字段。我可以通过将数组编号分配给组件的 JSON 来静态地做到这一点,但这显然不能解决动态工作的问题(这只是用来测试逻辑,因为它总是指向第一行)。我可以做什么/使用什么来使这个逻辑在数据网格中的每一行中独立工作?{"label": "Pay In Reason","widget": "choicesjs","hidden": true,"tableView": true,"data": {  "values": [    {      "label": "Employee",      "value": "employee"    },    {      "label": "Bank",      "value": "bank"    }  ],  "json": "",  "url": "",  "resource": "",  "custom": ""},"selectThreshold": 0.3,"key": "payInReason","conditional": {  "show": true,  "when": "dataGrid[0].payInOut",  "eq": "payIn"},"type": "select","indexeddb": {  "filter": {}},"input": true,"placeholder": "","prefix": "","customClass": "","suffix": "","multiple": false,"defaultValue": null,"protected": false,"unique": false,"persistent": true,"clearOnHide": true,"refreshOn": "","redrawOn": "","modalEdit": false,"labelPosition": "top","description": "","errorLabel": "","tooltip": "","hideLabel": false,"tabindex": "","disabled": false,"autofocus": false,"dbIndex": false,"customDefaultValue": "","calculateValue": "","calculateServer": false,"attributes": {},"validateOn": "change","validate": {  "required": false,  "custom": "",  "customPrivate": false,  "strictDateValidation": false,  "multiple": false,  "unique": false},"overlay": {  "style": "",  "left": "",  "top": "",  "width": "",  "height": ""},"allowCalculateOverride": false,"encrypted": false,"showCharCount": false,"showWordCount": false,"properties": {},"allowMultipleMasks": false,"clearOnRefresh": false,"limit": 100,"dataSrc": "values","valueProperty": "","lazyLoad": true,"filter": "","searchEnabled": true,"searchField": "","minSearch": 0,"readOnlyValue": false,"authenticate": false,"template": "<span>{{ item.label }}</span>","selectFields": "","searchThreshold": 0.3,"uniqueOptions": false,"fuseOptions": {  "include": "score",  "threshold": 0.3},"customOptions": {},"id": "eas39m"}谢谢你的帮助!
查看完整描述

1 回答

?
白衣非少年

TA贡献1155条经验 获得超0个赞

像这样的作品: show = (row.component === 'value')



查看完整回答
反对 回复 2022-12-22
  • 1 回答
  • 0 关注
  • 67 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信