J
J
jtag2017-06-10 17:31:18
JavaScript
jtag, 2017-06-10 17:31:18

How to generate javascript code multiple times depending on a variable?

Connected the Gantt module to display Gantt charts. However, it is required to add lines of this module depending on the variable from the database. The example below creates one row for the first channel. Is there any preprocessor built into the code so that you can repeat this piece of code (in the source property) several times?

$(".gantt").gantt({
          source: [{
          					name: "Channel 1",
          					desc: "",
          					values: [{
          						from: "/Date(1320192000000)/",
          						to: "/Date(1322401600000)/",
          						label: "Requirement Gathering",
          						customClass: "ganttRed"
          					}]
          				},
                ],


                
          scale: "days",
          minScale: "hours",
          maxScale: "days",
          navigate: "scroll"
        });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question