josdejong / jsoneditor

A web-based tool to view, edit, format, and validate JSON
http://jsoneditoronline.org
Apache License 2.0
11.23k stars 2.02k forks source link

load the JSON in jsoneditor and display as a expanded in json editor. #1547

Open Laxmikantwagh25 opened 9 months ago

Laxmikantwagh25 commented 9 months ago

I am loading/passing a JSON to jsoneditor on button click, but JSON is showing in collapsed and not expanded. I want to display the JSON in expanded automatically after loading/passing json to json editor.

How to achieve this?

Thanks, in advance.

josdejong commented 9 months ago

The editor by default loads JSON with the root object or array expanded. With the methods .expand(options) or .expandAll() you can expand more.

See docs: https://github.com/josdejong/jsoneditor/blob/develop/docs/api.md