[#51,bugfix][s]: fix for pulling fields from first row of data if no fields are provided (addendum to cb81fe87aff266e148428fbb5895552c4e66769f).

This commit is contained in:
Rufus Pollock 2012-03-29 08:21:34 +01:00
parent 724e6bfc39
commit 5fc486d808

View File

@ -29,7 +29,9 @@ this.recline.Backend = this.recline.Backend || {};
datasetInfo.fields = fields;
} else {
if (data) {
datasetInfo.fields = _.keys(data[0]);
datasetInfo.fields = _.map(data[0], function(cell) {
return {id: cell};
});
}
}
backend.addDataset(datasetInfo);