Skip to content

Conversation

@n1k0
Copy link
Collaborator

@n1k0 n1k0 commented Jan 9, 2016

Object fields ordering

The uiSchema object spec also allows you to define in which order a given object field properties should be rendered using the order property:

const schema = {
  type: "object",
  properties: {
    foo: {type: "string"},
    bar: {type: "string"}
  }
};

const uiSchema = {
  order: ["bar", "foo"]
};

render((
  <Form schema={schema}
        uiSchema={uiSchema} />
), document.getElementById("app"));

@n1k0 n1k0 force-pushed the object-fields-ordering branch 2 times, most recently from 9b92f17 to f0a577b Compare January 9, 2016 13:00
@n1k0 n1k0 force-pushed the object-fields-ordering branch from 163aff9 to f660dd4 Compare January 9, 2016 16:23
@n1k0
Copy link
Collaborator Author

n1k0 commented Jan 9, 2016

Bah, I realize you then can't use an object field named order. I'll come with another name, eg. ui:order.

@n1k0
Copy link
Collaborator Author

n1k0 commented Jan 9, 2016

Much better. Also, I'll have to rename widget to ui:widget as well for the same reason. I'll do that in a next PR.

Edit: opened #30

@n1k0 n1k0 merged commit 2998175 into master Jan 9, 2016
@n1k0 n1k0 deleted the object-fields-ordering branch January 9, 2016 16:47
@almet
Copy link
Contributor

almet commented Jan 11, 2016

Cool :')

epicfaace pushed a commit that referenced this pull request Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants