Ticket #2629 (closed enhancement: fixed)
Add pretty print option to dojo.toJson
| Reported by: | owen | Owned by: | owen |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 0.9 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Add a pretty print option to dojo.toJson, eg:
dojo.toJson(someObject)
returns the dense format, while
dojo.toJson(someObject, true)
returns the JSON output with indentation so that it's easy to read.
Also added a variable 'dojo.toJsonIndentStr' (default is tab) which can be used to change the default indent string -- for each level of "children" in the JSON output, we add one indentStr.
Also, added a simple JSON test to the test harness.
Change History
Note: See
TracTickets for help on using
tickets.