mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

Access objects contained in an array #966

Open resists21 opened 10 years ago

resists21 commented 10 years ago

I've got the following JSON output:

[{"username":"xxx","authorities":[{"authority":"ROLE_ADMINISTRATOR"}],"enabled":true,"lastname":"xxx","prename":"xxx","email":"xxx@xx.com","status":"xxx","ledIndex":1,"phoneNumbers":[]}]

How can I access the value of authority of the first object in the array authorities? With following column definition I just get the whole object:

{id: "authorities", name: "Berechtigung", field: "authorities",fieldIdx: 0, width: 105, editor: Slick.Editors.Text, sortable: true},

Thanks.

6pac commented 10 years ago

This is a javascript question, not a SlickGrid question. Simply, the JSON will have to processed and changed so that the property is no longer an array.