Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

[QUESTION] Can I add new keys to components? #451

@sofiaisreis

Description

@sofiaisreis

Hello, I am trying to add to specific things, in a component.
1 - First, on the values, besides 'Label' and 'Value': The value needs to be a number, not a string. Also, I need to have two fields such as 'NA', and 'Set to 0' (the second one will force the value of that row to be always 0).
2 - Secondly, I would like to add a weight option (numeric), below "Values".

exformio

The image above illustrates what I want to do. However I tried but couldn't figure out how to do it.
I'm using the builder with the angular framework, and typescript instead of javascript.
I'm using formoptions to acess and edit wich values I want to ignore or use, but how can I add new custom ones?

This is part of my html:

       <form-builder [form]="form" id="formBuilder" (change)="onChange($event) 
      [options]="formOptions"  [editForm]="editForm">
        </form-builder>

And my typescript code, to edit the radio component modal is:

this.formOptions = {
  editForm: {
    radio: [
          {
            key: 'display',
            ignore: 'false',
            components:
              [
                {
                  key: 'labelPosition',
                  ignore: true
                },
                {
                  key: 'optionsLabelPosition',
                  ignore: true
                },
                {
                  key: 'description',
                  ignore: true
                },
                {
                  key: 'customClass',
                  ignore: true
                },
                {
                  key: 'tabindex',
                  ignore: true
                },
                {
                  key: 'inline',
                  ignore: true
                },
                {
                  key: 'hidden',
                  ignore: true
                },
                {
                  key: 'hideLabel',
                  ignore: true
                },
                {
                  key: 'autofocus',
                  ignore: true
                },
                {
                  key: 'disabled',
                  ignore: true
                },
                {
                  key: 'tableView',
                  ignore: true
                },
                {
                  key: 'modalEdit',
                  ignore: true
                },
                {
                  key: 'customDefaultValue',
                  ignore: true
                }
              ]
          },
          {
            key: 'data',
            ignore: false,
            components:
              [
                {
                  key: 'values',
                  ignore: false,
                  components:
                    [
                      {
                        key: 'shortcut',
                        ignore: true
                      }
                    ]
                },
                {
                  key: 'defaultValue',
                  ignore: true
                },
                {
                  key: 'persistent',
                  ignore: true
                },
                {
                  key: 'protected',
                  ignore: true
                },
                {
                  key: 'dbIndex',
                  ignore: true
                },
                {
                  key: 'encrypted',
                  ignore: true
                },
                {
                  key: 'redrawOn',
                  ignore: true
                },
                {
                  key: 'defaultValue',
                  ignore: true
                },
                {
                  key: 'clearOnHide',
                  ignore: true
                },
                {
                  key: 'customDefault',
                  ignore: true
                }, {
                  key: 'customDefaultValue',
                  ignore: true
                },
                {
                  key: 'calculateValue',
                  ignore: true
                },
                {
                  key: 'calculateServer',
                  ignore: true
                },
                {
                  key: 'allowManualOverride',
                  ignore: true
                },
                {
                  key: 'dataType',
                  ignore: true
                },
                {
                  key: 'inline',
                  ignore: true
                },
                {
                  key: 'allowCalculateOverride',
                  ignore: true
                },
                {
                  key: 'defaultValueComponent',
                  ignore: true
                }
              ]
          },
          {
            key: 'layout',
            ignore: true
          },
          {
            key: 'conditional',
            ignore: true
          },
          {
            key: 'api',
            ignore: true
          },
          {
            key: 'logic',
            ignore: true
          },
          {
            key: 'validation',
            ignore: true
          }
        ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions