| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 
 | function __initDropDown(dropdownroot, dropimage, listitems, selectedValueField, selectedTextField, postback, showOnLoad, enabled, handleClick){
//try{
    var drop = document.getElementById(dropimage);
    if (enabled == "true"){
        drop.onmouseout = function(){
            if (drop != null) {
                drop.className = "drop";
                if (drop.parentNode != null) {
                    drop.parentNode.className = "selected";
                }
            }
        }
        drop.onmouseover = function(){
            if (drop != null) {
                drop.className = "drop dropon";
                if (drop.parentNode != null) {
                    drop.parentNode.className = "selected_focus";
                }
            }
        }
        drop.onmousedown = function(){
            if (drop != null) {
                drop.className = "drop dropclic";
            }
        }
        drop.onmouseup = function(){
            if (drop != null) {
                drop.className = "drop dropon";
            }
        }
        drop.onclick = function(event){
            __showDropDown(listitems,dropdownroot,event); 
            if (drop != null) {
                if (drop.parentNode != null) {
                drop.parentNode.className = "selected_focus";}
            }
        }
        drop.onfocus = function(event){
            if (drop != null) {
                if (drop.parentNode != null) {
                drop.parentNode.className = "selected_focus";
                }
            }
        }
        drop.onblur = function(event){
            if (drop != null) {
            if (drop.parentNode != null) {
                drop.parentNode.className = "selected";
                }
            }
        }
 
    }else{
    if (drop != null) {
        drop.className = "drop dropreadonly";
        }
    }
 
    var list = document.getElementById(listitems);
    __listdropdown.push(list);
 
    if (document.getElementById(showOnLoad).value.toLowerCase() != "true"){
        list.style.display = "none";
    }else{
        document.getElementById(listitems).style.display = "";
        if (document.getElementById(dropdownroot).clientWidth == 0){
            document.getElementById(listitems).style.width= "100%" ;
        }else{
            document.getElementById(listitems).style.width= document.getElementById(dropdownroot).clientWidth + "px" ;
        }
        idDdlOpen = listitems;
    }
    document.getElementById(showOnLoad).value = "false";
 
    drop.onkeyup = function(event){
        if (event != null) {
            touche = window.event ? event.keyCode : event.which;
            if (touche == 40) { // on déroule le menu lorsque l'on capture la touche fleche bas
                __showDropDown(listitems,dropdownroot,event);
            }
        }
    }
 
    var items = list.getElementsByTagName("div");
    for (var i=0; i<items.length; i++){
        if (items[i].parentNode == list){
            if (items[i].className = "item"){
                items[i].onmouseover = function(){
                    this.className = "itemover";
                }
                items[i].onmouseout = function(){
                    this.className = "item";
                }
 
                if (handleClick.toLowerCase() == "true"){
                    items[i].onclick = function(event){
                        selectedChanged = __handledropdownclick(this, dropdownroot, selectedValueField, selectedTextField, showOnLoad, event);
                        drop.focus();
                        if (selectedChanged){
                            eval(postback);
                        }
                    }
                } else {
                    items[i].onclick = function(event){
                        __stopPropagation(event);
                    }
                }
            }else{
                items[i].onclick = function(event){
                    __stopPropagation(event);
                }
            }
        }
    }
 
    list.onclick = function(event){
        __stopPropagation(event);
    }
//    }
//catch(err)
//{} 
} | 
Partager