=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-11-07 13:18:06 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2014-11-10 16:03:39 +0000 @@ -3281,12 +3281,18 @@ }); dataElementsByStageStore = Ext.create('Ext.data.Store', { - fields: [''], + fields: ['id', 'name', 'isAttribute'], data: [], - sorters: [{ - property: 'name', - direction: 'ASC' - }] + sorters: [ + { + property: 'isAttribute', + direction: 'DESC' + }, + { + property: 'name', + direction: 'ASC' + } + ] }); organisationUnitGroupStore = Ext.create('Ext.data.Store', { @@ -3530,6 +3536,11 @@ stages = program.programStages; attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute'); + // mark as attribute + for (var i = 0; i < attributes.length; i++) { + attributes[i].isAttribute = true; + } + // attributes cache if (Ext.isArray(attributes) && attributes.length) { attributeStorage[programId] = attributes; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-11-07 13:18:06 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2014-11-10 16:03:39 +0000 @@ -2921,12 +2921,18 @@ }); dataElementsByStageStore = Ext.create('Ext.data.Store', { - fields: [''], + fields: ['id', 'name', 'isAttribute'], data: [], - sorters: [{ - property: 'name', - direction: 'ASC' - }] + sorters: [ + { + property: 'isAttribute', + direction: 'DESC' + }, + { + property: 'name', + direction: 'ASC' + } + ] }); organisationUnitGroupStore = Ext.create('Ext.data.Store', { @@ -3167,6 +3173,11 @@ stages = program.programStages; attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute'); + // mark as attribute + for (var i = 0; i < attributes.length; i++) { + attributes[i].isAttribute = true; + } + // attributes cache if (Ext.isArray(attributes) && attributes.length) { attributeStorage[programId] = attributes; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-11-07 13:18:06 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2014-11-10 16:03:39 +0000 @@ -4185,12 +4185,18 @@ }); dataElementsByStageStore = Ext.create('Ext.data.Store', { - fields: [''], + fields: ['id', 'name', 'isAttribute'], data: [], - sorters: [{ - property: 'name', - direction: 'ASC' - }] + sorters: [ + { + property: 'isAttribute', + direction: 'DESC' + }, + { + property: 'name', + direction: 'ASC' + } + ] }); // components @@ -4271,6 +4277,11 @@ stages = program.programStages; attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute'); + // mark as attribute + for (var i = 0; i < attributes.length; i++) { + attributes[i].isAttribute = true; + } + // attributes cache if (Ext.isArray(attributes) && attributes.length) { attributeStorage[programId] = attributes;