Pessoal, não manjo muito de JS e estou com uma dúvida.
Estou montando uma tela em jsp com Gantt (jquery.fn.gantt.js).
No código abaixo tem dois trechos comentados, onde um é uma função de “clicar” em cima do projeto e mostrar alguma informação, outra é de colocar o mouse em cima (poover).
Só que não sei adicionar para cada projeto:
$(function() {
"use strict";
$(".gantt").gantt({
source: [{
name: "Projeto Teste",
desc: "Analysis",
values: [{
//ano/mes/dia cores ganttBlue, ganttRed, gantOrange, ganttGreen
from: "/Date(new Date('2015-01-02').getTime())/",
to: "/Date(new Date('2015-12-02').getTime())/",
label: "Projeto teste",
customClass: "ganttRed"
}]
},{
name: "Projeto2",
desc: "Scoping",
values: [{
from: "/Date(new Date('2016-01-02').getTime())/",
to: "/Date(new Date('2017-12-02').getTime())/",
label: "Scoping",
customClass: "ganttBlue"
}]
},
navigate: "scroll",
scale: "weeks",
maxScale: "months",
minScale: "days",
itemsPerPage: 10,
/* onItemClick: function(data) {
alert("Item clicked - show some details");
},
onAddClick: function(dt, rowId) {
alert("Empty space clicked - add an item!");
},
onRender: function() {
if (window.console && typeof console.log === "function") {
console.log("chart rendered");
}
} */
});
/* $(".gantt").popover({
selector: ".bar",
title: "I'm a popover",
content: "And I'm the content of said popover.",
trigger: "hover"
}); */
prettyPrint();
});