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

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/optionCombinationList.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
var selectedList;
 
2
var availableList;
 
3
 
 
4
function move( listId ) {
 
5
 
 
6
  var fromList = document.getElementById(listId);
 
7
 
 
8
  if ( fromList.selectedIndex == -1 ) { return; }
 
9
 
 
10
  if ( ! availableList ) {
 
11
    availableList = document.getElementById('availableList');
 
12
  }
 
13
 
 
14
  if ( ! selectedList ) {
 
15
    selectedList = document.getElementById('selectedList');
 
16
  }
 
17
 
 
18
  var toList = ( fromList == availableList ? selectedList : availableList );
 
19
 
 
20
  while ( fromList.selectedIndex > -1 ) {
 
21
    option = fromList.options.item(fromList.selectedIndex);
 
22
    fromList.remove(fromList.selectedIndex);
 
23
    toList.add(option, null);
 
24
  }
 
25
 
 
26
}
 
27
 
 
28
function submitForm() {
 
29
 
 
30
  if ( ! availableList ) {
 
31
    availableList = document.getElementById('availableList');
 
32
  }
 
33
 
 
34
  if ( ! selectedList ) {
 
35
    selectedList = document.getElementById('selectedList');
 
36
  }
 
37
 
 
38
  // selectAll(availableList);
 
39
  selectAll(selectedList);
 
40
 
 
41
  return false;
 
42
 
 
43
}
 
44
 
 
45
function selectAll(list) {
 
46
 
 
47
  for ( var i = 0, option; option = list.options.item(i); i++ ) {
 
48
    option.selected = true;
 
49
  }
 
50
 
 
51
}
 
 
b'\\ No newline at end of file'