formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
643 stars 471 forks source link

ViewOnly Mode #347

Closed shobanmr closed 9 months ago

shobanmr commented 5 years ago

viewOnly Mode in formio

Please provide as many details as you can:

Expected behavior

Screenshot from 2019-08-14 19-26-23

Observed behavior

Screenshot from 2019-08-14 19-30-23 Screenshot from 2019-08-14 19-29-58

Example

Screenshot from 2019-08-14 19-26-23

For code or form JSON, please enclose in a code block:

## app.component.html

<formio [form]='data' [submission]='{
  "data": {
    "firstName": "Joe",
    "lastName": "Smith",
    "email": "joe@example.com"
  }}' [viewOnly]="true"></formio>

##app.component.ts

data ={
    "title": "My Test Form",
    "components": [
        {
            "type": "textfield",
            "input": true,
            "tableView": true,
            "inputType": "text",
            "inputMask": "",
            "label": "First Name",
            "key": "firstName",
            "placeholder": "Enter your first name",
            "prefix": "",
            "suffix": "",
            "multiple": false,
            "defaultValue": "",
            "protected": false,
            "unique": false,
            "persistent": true,
            "validate": {
                "required": true,
                "minLength": 2,
                "maxLength": 10,
                "pattern": "",
                "custom": "",
                "customPrivate": false
            },
            "conditional": {
                "show": "",
                "when": null,
                "eq": ""
            }
        },
        {
            "type": "textfield",
            "input": true,
            "tableView": true,
            "inputType": "text",
            "inputMask": "",
            "label": "Last Name",
            "key": "lastName",
            "placeholder": "Enter your last name",
            "prefix": "",
            "suffix": "",
            "multiple": false,
            "defaultValue": "",
            "protected": false,
            "unique": false,
            "persistent": true,
            "validate": {
                "required": true,
                "minLength": 2,
                "maxLength": 10,
                "pattern": "",
                "custom": "",
                "customPrivate": false
            },
            "conditional": {
                "show": "",
                "when": null,
                "eq": ""
            }
        },
        {
            "input": true,
            "label": "Submit",
            "tableView": false,
            "key": "submit",
            "size": "md",
            "leftIcon": "",
            "rightIcon": "",
            "block": false,
            "action": "submit",
            "disableOnInvalid": true,
            "theme": "primary",
            "type": "button"
        }
    ]
  };
travist commented 5 years ago

viewOnly should map to the view mode you see in the app above. This is probably a bug. It is a pretty low priority one, so If you need quick resolution to this, then let me know and our support team will reach out to you about expedition.