1
0
mirror of synced 2025-02-16 20:13:16 +03:00

fix data helper when used with compound choices without a text attribute. fixes #370

This commit is contained in:
Igor Vaynberg 2012-08-31 13:41:56 -07:00
parent 7baa3b9e93
commit 222fa7e415

View File

@ -358,10 +358,14 @@
}
process = function(datum, collection) {
var group;
var group, attr;
datum = datum[0];
if (datum.children) {
group = { text: text(datum), children: [] };
group = {};
for (attr in datum) {
if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
}
group.children=[];
$(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
if (group.children.length) {
collection.push(group);