Question

I´ve implemented a dynatree on a web application, dynatree is generated from server with a JSON object. Dynatree works perfectly on Firefox, Safari, Chrome and Opera (last versions), but when I open on IE9, I just capable of loading the tree after refresh the page, or start the debug mode. I can´t find any mistake on console, script.... Any suggestion? someone with the same problem? Code:

function hacerPeticion(url, callback){
                var request;
                if(window.XMLHttpRequest){
                    request = new XMLHttpRequest();
                }else{
                    request = new ActiveXObject("Microsoft.XMLHTTP"); 
                }
                request.onreadystatechange = function(){
                    if (request.readyState == 4 && request.status == 200){
                        callback(request);
                    }
                }
                request.open("GET", url, true);
                request.send();
            }

Using the function:

hacerPeticion('/ServiciosWeb/Zonas.jsp', function(data){
                var data = JSON.parse(data.responseText);
                var arbol = data;
                eval('var obj='+arbol);
                console.log(obj);
           $(function(){
                    $("#tree3").dynatree({
                        checkbox: true,
                        selectMode: 3,
                        children: obj,
                        onSelect: function(select, node) {

                            if(!select){
                                if(node.data.key=="zonas"){
                                    control=false;
                                    cargaMapaCYL(map, control);
                                }
                                if(node.data.key=="ast"){
                                    control=false;
                                    cargaMapaAst(map, control);
                                }
                            /*Nodos seleccionados*/
                            if(select){
                                if(node.data.key=="zonas"){
                                    control=true;
                                    cargaMapaCYL(map, control);
                                }
                                if(node.data.key=="ast"){
                                    control=true;
                                    cargaMapaAst(map, control);
                                }
                            }

                        onDblClick: function(node, event){
                            node.toggleSelect();
                        },
                        onKeydown: function(node, event) {
                            if( event.which == 32 ) {
                                node.toggleSelect();
                                return false;
                            }
                        }
                    });

Thanks in advance.

Was it helpful?

Solution

So....., the problem is in this line:

console.log(obj);

When I have retired this line everything works fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top