Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

displaying nested attributes in backgrid

Tags:

backgrid

I have a json object in the following format:

{
    properties:{
                  url:"http://..."
               }
}

And I want to display the url in a Backgrid grid. However, I can't figure out how to change the name attribute of the column such that it accesses the nested url. I have tried the following examples to no avail:

{
    name: "properties.url",
    label: "URL",
    cell: "uri"
}

And

{
    name: "properties[url]",
    label: "URL",
    cell: "uri"
}

It seems like a simple enough thing to do but I can't find an answer.

like image 410
anubhavashok Avatar asked Feb 21 '14 04:02

anubhavashok


1 Answers

Take a look at Backbone's Wiki.

There are at least 4 choices:

  • backbone-deep-model
  • backbone-nested
  • backbone-nestify
  • backbone-dotattr
like image 78
Y.H Wong Avatar answered Dec 29 '22 00:12

Y.H Wong