json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

Out of order properties

Open nipunarora opened this issue 8 years ago • 5 comments

I have the following configuration, However, I observe that my view the sections are coming in the wrong order. Can you give me any suggestions for a fix.

schema:{
            "title": "NGLA Schema",
            "type": "object",
            "options":{
                        "disable_collapse": true
                    },
            "properties":{
                 "project": {
                      "title": "Project",
                      "$ref": "#/definitions/project"
                  },
                 "sources": {
                      "title": "Source",
                      "$ref": "#/definitions/source"
                  },
                  "type1": {
                      "title": "Pattern Recognition",
                      "$ref": "#/definitions/type1"
                  },
                  "type2": {
                      "title": "Type 2 Parameters",
                      "$ref": "#/definitions/type2"
                  },
                  "type3": {
                      "title": "Sequence Analysis",
                      "$ref": "#/definitions/type3"
                  },
                  "type4": {
                      "title": "Volume Analysis",
                      "$ref": "#/definitions/type4"
                  },
                  "type5": {
                      "title": "Type 5 Analysis",
                      "$ref": "#/definitions/type5"
                  },
                  "type6": {
                      "title": "Type 6 Parameters",
                      "$ref": "#/definitions/type6"
                  },
                  "type7": {
                      "title": "Type 7 Analysis",
                      "$ref": "#/definitions/type7"
                  },
                  "type8": {
                      "title": "Type 8 Analysis",
                      "$ref": "#/definitions/type8"
                  },
                  "type9": {
                       "title": "Type 9 Analysis",
                       "$ref": "#/definitions/type9"
                  }
            },

nipunarora avatar May 26 '16 01:05 nipunarora

The problem seems to come when I introduce an empty property. i.e. one in which I just want a section and no actual key-values to be entered:

"type5":
                {
                    "id": "type5",
                    "type": "object",
                    "format": "grid",
                    "options":{
                        "disable_collapse": true
                    }
                },

nipunarora avatar May 26 '16 01:05 nipunarora

I am facing the same issue. The order of the view is not matching the schema. Any help !

manojgn avatar May 27 '16 06:05 manojgn

Have you tried implementing property ordering?

https://github.com/jdorn/json-editor#property-ordering

WrathZA avatar May 27 '16 06:05 WrathZA

Property ordering works but one would have liked the order to be same the either the schema order or the json order. Is it possible to do that ?

manojgn avatar Jul 18 '16 05:07 manojgn

having the same issue, I have large schema, don't wanna use propertyOrder redundantly, since the order is expected to be the same as in schema..

emilb604 avatar Feb 28 '18 18:02 emilb604