jdorn / json-editor

JSON Schema Based Editor
MIT License
5.8k stars 1.08k forks source link

Start with entire form expanded? #805

Closed tonebender closed 6 years ago

tonebender commented 6 years ago

Sorry if this has been asked before -- I looked but couldn't find it. When I create a form from a schema, and load it with some data (using startval), it initially only shows the fields that actually have data from the startval. I want it to show the whole form (the whole schema) including empty fields (regardless if they have default values or not). Is that possible?

aceSkotheim commented 6 years ago

Had this issue as well and found solution elsewhere. Use the line below to populate your data and show the entire form. editor.root.setValue(data, true);

danielo515 commented 6 years ago

Thank you very much @aceSkotheim , your solution works like a charm

tonebender commented 6 years ago

Thanks!!!

tonebender commented 6 years ago

Or actually, I take that back. :-| It didn't really work. When I do for example: editor.root.setValue(my_json_object_with_values, true); it does not expand all the fields from the schema. It still only shows the properties that have data from the data object and I still need to click on Object Properties and check all the properties I want to view.

Can you explain more in detail how I should use editor.root.setValue(data, true) ?

Thanks!

schmunk42 commented 6 years ago

This repo is no longer maintained (see also https://github.com/jdorn/json-editor/issues/800)

Development is continued at https://github.com/json-editor/json-editor

For details please visit https://github.com/json-editor/json-editor/issues/5

tonebender commented 6 years ago

Thanks for the heads-up! I'll check it out and let this be.