This is a migrated thread and some comments may be shown as answers.

Posting Back Observable Arrays

3 Answers 86 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 24 May 2012, 08:03 PM
Hi,
I think this might be a dumb question but I am stumped. I have a view model with a property that contains an array of 'objects'. When I stringify this, my array property isn't being deserialized as an array, but rather I get something that looks like this:
\"Metrics\":{\"0\":{\"Id\":19,\"Curren...}, "\1\": { ....

I was expecting something like:
Metrics : [{"Id":19, "Current": 12.34155...}, {"Id": 23, "Current....}, ...]

When I post this all back through ajax my property of Metrics does not get deserialized properly by asp.net mvc.

Any help would be appreciated,
ian

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 25 May 2012, 10:48 AM
Hi,

 This could be caused by an issue which we fixed in the service pack (version 2012.1 515). Which version are you using?

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ian
Top achievements
Rank 1
answered on 25 May 2012, 02:39 PM
Hello,
Thanks for the response. We are currently using kendoui.web.2012.1.515.

If no one else is experiencing any issues, it must be something I've done. Do you have an example of 'extracting' the json data back out of a view model with the structure of
{
Prop1: 'a'
Prop2: 4
Prop3: [{name: 'foo', val: 1}, {name: 'foo2', val: 3}...]
}

for example.


ian
0
Iliana Dyankova
Telerik team
answered on 29 May 2012, 08:18 AM
Hello Ian,

Our developer team has recently resolved a similar issue and the fix is available with the latest internal build. I would suggest to open a support ticket (since we can't send internal builds in public forum) where we will send you one.


Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
Ian
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ian
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Share this question
or