web/js/file_manager.js
/**
 * Shows the content of the data upload to the application
 */
Shows the content of the data upload to the application
Shows the content of the data upload to the application
function show_file() {
    var data = JSON.parse(sessionStorage["data"]);
	if (!data) {
        $("#danger").html("There is no file uploaded.").show();
    } else {
        var salida = "<thead><tr>";
        if (data.dataset.length != 0) {
            salida = salida + "<th>Dataset</th>";
        }
        $.each(data.names, function(index, value) {
            salida = salida + "<th>" + value + "</th>";
        });
        salida = salida + "</tr></thead><tbody>";
        for (var i = 0; i < data.values[data.names[0]].length; i++) {
            salida = salida + "<tr>";
            if (data.dataset.length != 0) {
                salida = salida + "<td>" + data.dataset[i] + "</td>";
            }
            $.each(data.names, function(j, name) {
                salida = salida + "<td>" + data.values[name][i] + "</td>";
            });
            salida = salida + "</tr>";
        }
        salida = salida + "</tbody>";
        $('#file_table').html(salida);
    }
}
function show_file ( ) { var data = JSON . parse ( sessionStorage [ "data" ] ) ; if ( ! data ) { $ ( "#danger" ) . html ( "There is no file uploaded." ) . show ( ) ; } else { var salida = "<thead><tr>" ; if ( data . dataset . length != 0 ) { salida = salida + "<th>Dataset</th>" ; } $ . each ( data . names , function ( index , value ) { salida = salida + "<th>" + value + "</th>" ; } ) ; salida = salida + "</tr></thead><tbody>" ; for ( var i = 0 ; i < data . values [ data . names [ 0 ] ] . length ; i ++ ) { salida = salida + "<tr>" ; if ( data . dataset . length != 0 ) { salida = salida + "<td>" + data . dataset [ i ] + "</td>" ; } $ . each ( data . names , function ( j , name ) { salida = salida + "<td>" + data . values [ name ] [ i ] + "</td>" ; } ) ; salida = salida + "</tr>" ; } salida = salida + "</tbody>" ; $ ( '#file_table' ) . html ( salida ) ; } }
Shows the content of the data upload to the application
Shows the content of the data upload to the application