Opened 12 years ago

Closed 12 years ago

#3627 closed enhancement (fixed)

[dojo.data] add JsonItemStore support for Dates and custom datatypes

Reported by: skinner Owned by: skinner
Priority: high Milestone:
Component: Data Version: 0.9
Keywords: Cc: jared.jurkiewicz@…
Blocked By: Blocking:

Description

Make it possible to have date literals in a JSON file that JsonItemStore reads. For example:

{ items: [
    { name:'Eritrea',
      capital:'Asmara',
      independence:{_type:'Date', _value:738226800000} // May 24, 1993
    }
]}

And make it possible to have custom data types for literal values, by specifying a 'typeMap' in the constructor, like this:

var store = new dojo.data.JsonItemStore({
	url:"muppets",
	typeMap:{'Color':dojo.Color}
});

for reading a file like this:

{ items: [
    { name:'Kermit', 
      species:'frog', 
      color:{_type:'Color', _value:'green'} },
    { name:'Beaker', 
      hairColor:{_type:'Color', _value:'red'} }
]};

Change History (1)

comment:1 Changed 12 years ago by skinner

Resolution: fixed
Status: newclosed

(In [9484]) fixes #3627 fixes #3628

tested in: [Firefox 2.0, Safari 3.0, IE 6.0]

Note: See TracTickets for help on using tickets.