rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
974 stars 363 forks source link

Nested object support #46

Open rstaib opened 9 years ago

rstaib commented 9 years ago

This feature enables native access to subproperties of a field (see example below).

...
<th data-column-id="person.id">Person ID</th>
<th data-column-id="person.age">Age</th>
...

Here person is actually one field. But instead of being a value like number or string it's an object that has properties which are holding the content we're interested in (e.g. age, id and so on). See the example object below.

{
    ...
    rows: [
        ...
        {
            ...
            person: { id: "p-01", age: 55 }
        }
    ]
}

Many thanks to Mohammed Riyad El Khoudary for conceptional work.

ChrisRM commented 9 years ago

+1 :+1:

kaitlynreese commented 8 years ago

+1

treetopvt commented 8 years ago

I think this is a critically important enhancement. I've tried to handle it with converters, but I haven't had any luck thus far.

dannyrose42 commented 8 years ago

+1

javarebel commented 8 years ago

Try data-formatter. formatters: { "age": function(column, row) { return row.person.age; } }

rulogarcillan commented 8 years ago

My data does not show me, what is my mistake?

`{  
   "current":"1",
   "rowCount":"10",
   "rows":[  
      {  
         "_id":"57e3cd01cd4ff73adfe6a7b2",
         "evento":"prueba1",
         "fecha":"2016-09-05",
         "tipo":"prueba1",
         "textolibre":"This is a....",
         "localizacion":{  
            "continente":"am",
            "pais":"El Salvador",
            "ciudad":"El salvador"
         },
         "__v":0
      }
   ],
   "total":1
}

    <th data-column-id="localizacion.pais" data-type="string">Pais</th>`
sergii-zhuravel commented 7 years ago

Are there any plans about this feature?

stvowi commented 7 years ago

http://gijgo.com/grid/demos/nested-jquery-grids