Skip to content

Enhanced input types #83

@kalgon

Description

@kalgon

I have a usecase where a user has to choose a node in a tree structure.

I could represent that choice as a select/radio input but it could grow too big and it would be nicer if the real tree structure was shown in the form (instead of an flattened structure).

I would prefer to keep select/radio as input type over a new/custom one (tree) because select/radio are standard and degrade gracefully if the client would not know about the new (non-standard) type.

Therefore, I need some extra information about how my input could be rendered.

Is there anything in the current spec that would allow me to do that?

I had something like this in mind:

{
  "_templates" : {
    "default" : {
      ...
      "properties" : [
        {
          "name" : "directory",
          "prompt" : "Directory",
          "type" : "select",
          "options" : {
            "inline" : [
              "foo",
              "foo/bar",
              "foo/bar/baz",
              "foo/bar/qux",
              "bar",
              "bar/baz/qux",
              ...
            ]
          },
          "hints" : {
            "tree" : {
              "separator" : "/",
              "collapseAtLevel" : 2
            }
          }
        }
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions