Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
How to retrun variable value to the js?

I want to return the value of P221_JSON_PROCESS item to the variable and then return the value to the new vis.DataSet. I tried as follows:

// P221_JSON_PROCESS contains - { id: 1, label: "Node 1" },

function returnNodes() {
var process = document.getElementById("P221_JSON_PROCESS").value;
return process;
} 

var nodes = new vis.DataSet([
  returnNodes();
]);

// create an array with edges
var edges = new vis.DataSet([
]);

// create a network
var container = document.getElementById("mynetwork");
var data = {
  nodes: nodes,
  edges: edges,
};
var options = {};
var network = new vis.Network(container, data, options); 

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use add method like

var nodes = edges.add([returnNodes()]);

or

var nodes = new vis.DataSet([,returnNodes()]);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda