|
|
@ -663,15 +663,17 @@ DataSet.prototype._filterFields = function (item, fields) { |
|
|
|
|
|
|
|
var filteredItem = {}; |
|
|
|
|
|
|
|
for (var field in item) { |
|
|
|
if(Array.isArray(fields)){ |
|
|
|
if (item.hasOwnProperty(field) && (fields.indexOf(field) != -1)) { |
|
|
|
filteredItem[field] = item[field]; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if (item.hasOwnProperty(field) && fields.hasOwnProperty(field)) { |
|
|
|
filteredItem[fields[field]] = item[field]; |
|
|
|
} |
|
|
|
if(Array.isArray(fields)){ |
|
|
|
for (var field in item) { |
|
|
|
if (item.hasOwnProperty(field) && (fields.indexOf(field) != -1)) { |
|
|
|
filteredItem[field] = item[field]; |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
for (var field in item) { |
|
|
|
if (item.hasOwnProperty(field) && fields.hasOwnProperty(field)) { |
|
|
|
filteredItem[fields[field]] = item[field]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|