Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

How to set a unique key for a custom component that doesn't change according to label? #441

Closed
Morshed0308 opened this issue Jun 25, 2019 · 3 comments

Comments

@Morshed0308
Copy link

Morshed0308 commented Jun 25, 2019

Hello I want the key property of JSON schema to be a unique key which doesn't change on label name ,How I can I do that?

For example

"components": [
        {
            "label": "Text Field",
            "allowMultipleMasks": false,
            "showWordCount": false,
            "showCharCount": false,
            "tableView": true,
            "alwaysEnabled": false,
            "type": "textfield",
            "input": true,
            **"key": "Mycustomkey",**
            "defaultValue": "",
}

I want to keep this key name no matter what I put on label name on this component.

@travist @randallknutson

@randallknutson
Copy link
Contributor

In the newer versions of our form builder (in formio.js) the key is not modified for any existing components. It is only generated when the component is first added to the form. You may want to try updating to the latest beta version of ngFormio (which now includes the builder instead of being in a separate module) and see how it works.

@Morshed0308
Copy link
Author

Okay,thanks ! I will try that ! but in the old version is there any way I can set the key specific and it doesn't change on label name?
@randallknutson

@wag110894
Copy link

You can change the API key in the API tab of each component. It is labeled "Property Name". This will not change the label name of the component.

Hope this helps.

Thanks.

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

No branches or pull requests

3 participants