Changeset 61637e1 in sicp for static


Ignore:
Timestamp:
Aug 10, 2015, 2:40:08 PM (9 years ago)
Author:
Ing. Roldan D. Vargas G <rvargas@…>
Branches:
master
Children:
8886eb7
Parents:
322ec56
Message:

agregada función que permite obtener la cadena productiva en árbol de acuerdo a la cadena seleccionada por el usuario

File:
1 edited

Legend:

Unmodified
Added
Removed
  • static/js/ajax-request.js

    r59e5a1e r61637e1  
    248248    });
    249249}
     250
     251/**
     252 * @brief Función que obtiene los datos de la cadena modificada consultada
     253 *
     254 * @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
     255 * @copyright GNU/GPLv2
     256 * @date 07-08-2015
     257 * @param url       Variable de tipo string que contiene la URL que procesa la perición
     258 * @param cadena_id Variable de tipo string que contiene el identificador de la cadena a consultar
     259 * @return Devuelve los datos de la cadena a mostrar en el treeview
     260 */
     261function get_tree_cadena_modificada(url, cadena_id) {
     262    var treeSet = [];
     263    var nombre = '';
     264    $.getJSON(url, {cadena_id:cadena_id}, function(datos) {
     265        if (datos.resultado) {
     266            nombre = datos.cadena_nombre;
     267            for (n in datos.node) {
     268                treeSet.push(datos.node[n]);
     269            }
     270        }
     271        else {
     272            bootbox.alert(datos.error);
     273        }
     274    }).fail(function(jqxhr, textStatus, error) {
     275        var err = textStatus + ", " + error;
     276        bootbox.alert(ERROR_AJAX_REQUEST + err);
     277    });
     278
     279    return {
     280        "nombre": nombre,
     281        "tree": treeSet
     282    };
     283}
Note: See TracChangeset for help on using the changeset viewer.