nnajm / orb

Pivot table javascript library
https://nnajm.github.io/orb/
MIT License
556 stars 173 forks source link

Drill down: empty grid when data source is an array of objects #19

Closed nnajm closed 9 years ago

ValentinH commented 9 years ago

I was writing the same issue exactly in the same time! I provided a patch in a pull request for it... ;)

Here's the content of my issue report:

In the example, the drill-down works correctly but in my case, I use a datasource which consists in an array of objects and the drill-down grid is always empty.

I have noticed that this line is the source of the problem because it iterates on data[i].length while data[i] is an object.

If I replace it by:

for(var j in data[i]) {

it works for array of arrays and array of objects.

nnajm commented 9 years ago

:thumbsup: