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

Client Binding with nexted JSON objects

1 Answer 8 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 06 Nov 2018, 03:09 PM

Hello

I'm trying to bind a List view to a JSON object, simplified to:

{
   "Data":[
      {
         "<ClaimItemID>k__BackingField":256,
         "<MasterClaim>k__BackingField":{
            "<PoliceStation>k__BackingField":"Bobville",
         },
         "<AdditionalDetails>k__BackingField":"",
         "<ItemDescription>k__BackingField":"Lilly ",
      }
   ],
   "Count":1
}

<div>#= ClaimItemID #</div>

is working as expected

but

<div>#= MasterClaim.PoliceStation #</div>

is throwing this error

Error rendering ItemTemplate in lstClaims: MasterClaim is not defined

what am i doing wrong?

 

1 Answer, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 2
answered on 08 Nov 2018, 10:20 AM

I solved this problem by flattening the JSON during the serialisation process.

not the solution i wanted, but it works.

Tags
ListBox
Asked by
Jason
Top achievements
Rank 2
Answers by
Jason
Top achievements
Rank 2
Share this question
or