Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customFormItems doesn't support "disabled": true for nested items in a selectfieldset #23

Open
epitomus opened this issue Aug 17, 2015 · 3 comments

Comments

@epitomus
Copy link

Using customFormItems to customise sub-form items doesn't seem to support "disabled": true. In the following example, the "text.text1" field should be disabled:

{
  "schema": {
    "choice": {
      "type": "string",
      "enum": [ "text", "cat" ]
    },
    "text": {
      "type": "object",
      "properties": {
        "text1": {
          "type": "string",
          "title": "Text1"
        },
        "text2": {
          "type": "string",
          "title": "Text2"
        }
      }
    },
    "category": {
      "type": "string",
      "title": "Category",
      "enum": [
        "Geography",
        "Entertainment",
        "History",
        "Arts",
        "Science",
        "Sports"
      ]
    }
  },
  "form": [
    {
      "type": "selectfieldset",
      "key": "choice",
      "title": "Make a choice",
      "titleMap": {
        "text": "Search by text",
        "cat": "Search by category"
      },
      "items": [
        {
          "key": "text",
        },
        {
          "key": "category"
        }
      ],
     },
    {
      "type": "submit",
      "value": "Submit"
    }
  ],
  "customFormItems": {
    "text.text1": {
      "append": "today",
      "disabled": true
    },
    "text.text2": {
      "append": "tomorrow"
    }
  }
}
@ulion
Copy link
Owner

ulion commented Aug 17, 2015

As I said, it's not "customFormItems", it's probably "selectfieldset"
caused problem.

2015-08-17 14:04 GMT+08:00 epitomus notifications@github.com:

Using customFormItems to customise sub-form items doesn't seem to support "disabled":
true. In the following example, the "text.text1" field should be disabled:

{
"schema": {
"choice": {
"type": "string",
"enum": [ "text", "cat" ]
},
"text": {
"type": "object",
"properties": {
"text1": {
"type": "string",
"title": "Text1"
},
"text2": {
"type": "string",
"title": "Text2"
}
}
},
"category": {
"type": "string",
"title": "Category",
"enum": [
"Geography",
"Entertainment",
"History",
"Arts",
"Science",
"Sports"
]
}
},
"form": [
{
"type": "selectfieldset",
"key": "choice",
"title": "Make a choice",
"titleMap": {
"text": "Search by text",
"cat": "Search by category"
},
"items": [
{
"key": "text",
},
{
"key": "category"
}
],
},
{
"type": "submit",
"value": "Submit"
}
],
"customFormItems": {
"text.text1": {
"append": "today",
"disabled": true
},
"text.text2": {
"append": "tomorrow"
}
}
}


Reply to this email directly or view it on GitHub
#23.

Ulion

@epitomus
Copy link
Author

You are more likely to be right about this than I am :)

@ulion
Copy link
Owner

ulion commented Aug 17, 2015

currently, you can use readonly as a workaround. since the selectfieldset
operate on fields with disable/enable operations, it probably does not
consider the disabled true case. PR is welcome if anyone want to fix it.

2015-08-17 14:20 GMT+08:00 epitomus notifications@github.com:

You are more likely to be right about this than I am :)


Reply to this email directly or view it on GitHub
#23 (comment).

Ulion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants