=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js' --- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-07-18 09:43:36 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-07-19 09:16:10 +0000 @@ -4488,11 +4488,12 @@ // If fav has organisation units, wait for tree callback before update if (recMap[dimConf.organisationUnit.objectName] && Ext.isObject(graphMap)) { treePanel.numberOfRecords = pt.util.object.getLength(graphMap); - for (var key in graphMap) { - if (graphMap.hasOwnProperty(key)) { - treePanel.multipleExpand(key, graphMap[key], false); - } - } + + for (var i = 0, a = xLayout.objectNameItemsMap[dimConf.organisationUnit.objectName]; i < a.length; i++) { + if (graphMap.hasOwnProperty(a[i].id)) { + treePanel.multipleExpand(a[i].id, graphMap[a[i].id], false); + } + } } else { treePanel.reset(); === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-07-17 13:46:09 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-07-19 09:16:10 +0000 @@ -4575,11 +4575,12 @@ // If fav has organisation units, wait for tree callback before update if (recMap[dimConf.organisationUnit.objectName] && Ext.isObject(graphMap)) { treePanel.numberOfRecords = dv.util.object.getLength(graphMap); - for (var key in graphMap) { - if (graphMap.hasOwnProperty(key)) { - treePanel.multipleExpand(key, graphMap[key], false); - } - } + + for (var i = 0, a = xLayout.objectNameItemsMap[dimConf.organisationUnit.objectName]; i < a.length; i++) { + if (graphMap.hasOwnProperty(a[i].id)) { + treePanel.multipleExpand(a[i].id, graphMap[a[i].id], false); + } + } } else { treePanel.reset();