Ticket #2629 (closed enhancement: fixed)

Opened 20 months ago

Last modified 18 months ago

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

Changed 20 months ago by owen

  • status changed from new to assigned
  • type changed from defect to enhancement

Changed 20 months ago by owen

  • status changed from assigned to closed
  • resolution set to fixed

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

Changed 18 months ago by anonymous

  • milestone deleted

Milestone 0.9M1 deleted

Note: See TracTickets for help on using tickets.