Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#2629 closed enhancement (fixed)

Add pretty print option to dojo.toJson

Reported by: owen Owned by: owen
Priority: high Milestone:
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

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 (3)

comment:1 Changed 13 years ago by owen

Status: newassigned
Type: defectenhancement

comment:2 Changed 13 years ago by owen

Resolution: fixed
Status: assignedclosed

(In [7750]) fixes #2629 -- ads prettyPrint option to dojo.toJson, added JSON tests to harness

comment:3 Changed 12 years ago by (none)

Milestone: 0.9M1

Milestone 0.9M1 deleted

Note: See TracTickets for help on using tickets.