Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!