0

我刚开始弄乱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"
}

谢谢你的帮助!

4

1 回答 1

0

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

于 2020-08-08T15:30:48.587 回答