Projets

json

Fiche dévaluation par compétences :

Not Found

The requested document was not found on this server.


Web Server at pedagolab.fr
; var transforms = { 'object':{'tag':'div','class':'package ${show} ${type}','children':[ {'tag':'div','class':'header','children':[ {'tag':'div','class':function(obj){ if( getValue(obj.value) !== undefined ) return('arrow hide'); else return('arrow'); }}, {'tag':'span','class':'name','html':'${name}'}, {'tag':'span','class':'value','html':function(obj) { var value = getValue(obj.value); if( value !== undefined ) return(" : " + value); else return(''); }}, {'tag':'span','class':'type','html':'${type}'} ]}, {'tag':'div','class':'children','children':function(obj){return(children(obj.value));}} ]} }; $(function(){ $('#inputJSON').val(JSON.stringify(json2)); //Visualize sample visualize(json2); }); function visualize(json) { $('#top').html(''); $('#top').json2html(convert('Competences ISN',json,'open'),transforms.object); regEvents(); } function getValue(obj) { var type = $.type(obj); //Determine if this object has children switch(type) { case 'array': case 'object': return(undefined); break; case 'function': //none return('function'); break; case 'string': return(' ' + obj + ' '); break; default: return(obj); break; } } //Transform the children function children(obj){ var type = $.type(obj); switch(type) { case 'array': case 'object': return($.json2html(obj,transforms.object)); break; default: break; } } function convert(name,obj,show) { var type = $.type(obj); var typeA = 'indicateur'; if(show === undefined) show = 'closed'; var children = []; switch(type) { case 'array': typeA='capacite'; var len=obj.length; for(var j=0;j

Commentaires :