Client Binding with nexted JSON objects

2 posts, 0 answers
  1. Jason
    Jason avatar
    29 posts
    Member since:
    Aug 2009

    Posted 06 Nov 2018 Link to this post

    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?

     

  2. Jason
    Jason avatar
    29 posts
    Member since:
    Aug 2009

    Posted 08 Nov 2018 Link to this post

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

    not the solution i wanted, but it works.

Back to Top