I'm using the knockout mapping plugin. The simplified json I'm getting is in the form of an unnamed array.
[
{"ID":1,"Title":"Title 1"},
{"ID":2,"Title":"Title 2"},
{"ID":3,"Title":"Title 3"}
]
In order to have a named "Items" property in my viewmodel, I'm assigning like this:
var model = { Items: ko.mapping.fromJS(jsondata, mappingOptions) }
I'm having trouble adding the isDirty property during the mapping process. I'm starting to wonder if I'm approaching this the wrong way.
Here is a JsFiddle
UPDATE
Here is a working JsFiddle based on the answer below.