~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/detailedExport.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
function dataElementCriteriaChanged()
 
3
{
 
4
    clearFilter( "dataElementFilter", "availableDataElements" );
 
5
    
 
6
    var dataElementGroupId = getListValue( "dataElementGroupList" );
 
7
    var dataDictionaryId = getListValue( "dataDictionaryDataElementList" );
 
8
    
 
9
    var url = "getDataElementList.action";
 
10
    
 
11
    $.getJSON(
 
12
        url,
 
13
        {
 
14
            "dataDictionaryId": dataDictionaryId,
 
15
            "dataElementGroupId": dataElementGroupId
 
16
        },
 
17
        function( json )
 
18
        {
 
19
            var list = document.getElementById( "availableDataElements" );
 
20
            
 
21
            clearList( list );
 
22
            
 
23
            var objects = json.dataElements;
 
24
            
 
25
            for ( var i=0; i<objects.length; i++ )
 
26
            {
 
27
                addOptionToList( list, objects[i].id, objects[i].name );
 
28
            }
 
29
        }
 
30
    );
 
31
}
 
32
 
 
33
function indicatorCriteriaChanged()
 
34
{
 
35
    clearFilter( "indicatorFilter", "availableIndicators" );
 
36
    
 
37
    var indicatorGroupId = getListValue( "indicatorGroupList" );
 
38
    var dataDictionaryId = getListValue( "dataDictionaryIndicatorList" );
 
39
    
 
40
    var url = "getIndicatorList.action";
 
41
    
 
42
    $.getJSON(
 
43
        url,
 
44
        {
 
45
            "dataDictionaryId": dataDictionaryId,
 
46
            "indicatorGroupId": indicatorGroupId
 
47
        },
 
48
        function( json )
 
49
        {
 
50
            var list = document.getElementById( "availableIndicators" );
 
51
            
 
52
            clearList( list );
 
53
            
 
54
            var objects = json.indicators;
 
55
            
 
56
            for ( var i=0; i<objects.length; i++ )
 
57
            {
 
58
                addOptionToList( list, objects[i].id, objects[i].name );
 
59
            }
 
60
        }
 
61
    );
 
62
}
 
63
 
 
64
function exportDetailedMetaData()
 
65
{
 
66
    selectAllById( "selectedDataElements" );
 
67
    selectAllById( "selectedIndicators" );
 
68
    
 
69
    document.getElementById( "exportForm" ).submit();
 
70
}