React-jsonschema-form: field ordering in UISchema could allow ordering of nested properties

Created on 7 Oct 2016  路  8Comments  路  Source: rjsf-team/react-jsonschema-form

Hi everyone,

First of all, I would like to thank you for your component, it eases my programming life.

I have a JSON Schema built from a Java domain class with nested object properties at multiple levels.
I would like to know if it is possible to order nested properties (or fields) like in this following UI Schema:

{
  "ui:order": [
    "topField1",
    "topField2",
    ...
  ],
  "topField1": {
    "ui:order": [
      "nestedField1",
      "nestedField2",
      ...
    ]
  },
  "nestedField1": {
    "ui:order": [
      "otherField1",
      "otherField2",
      ...
    ]
  }
}

In this case, fields within topField1 are well ordered, but not the fields in nestedField1.
Maybe I am doing something wrong!

Thank you for your help,

Pascal

Most helpful comment

I have this problem too.
Anyone knows how to set order for object properties? Thanks.

All 8 comments

I have this problem too.
Anyone knows how to set order for object properties? Thanks.

I tried to reorganize the properties, but that doesn't seem to help.

Provided this schema:

{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "properties": {
    "c": {"type": "string"},
    "b": {"type": "string"},
    "a": {
      "type": "object",
      "properties": {
        "e": {"type": "string"},
        "d": {"type": "string"}
      }
    }
  }
}

Everything can be ordered just fine with this uiSchema:

{
  "ui:order": [
    "a",
    "b",
    "c"
  ],
  "a": {
    "ui:order": [
      "d",
      "e"
    ]
  }
}
  1. Am I missing something?
  2. Is it a documentation issue? How could it be improved? Who wants to work on it?

As I said, fields at first level are well ordered, like in the example above, but not "deeper" fields.

In my example above fields within a are ordered fine.

Ok I may just be tired, so could you please help me understanding the issue by providing a working example in jsfiddle? Here's the example from my previous comment https://jsfiddle.net/nox69jr3/1/

Thanks in advance for your help

I've updated your example: https://jsfiddle.net/nox69jr3/3/

As you can see the inner fields g,h and i are not ordered as expected.

You're not nesting at the right level https://jsfiddle.net/nox69jr3/4/

Can I close the issue?

That was so simple. I thought I had checked this way though.
Sorry for the time lost, and thank you for the good job. I close.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mfulton26 picture mfulton26  路  3Comments

sstarrAtmeta picture sstarrAtmeta  路  3Comments

j-zimnowoda picture j-zimnowoda  路  3Comments

MedinaGitHub picture MedinaGitHub  路  3Comments

mammad2c picture mammad2c  路  3Comments