Dynamically graffic jquery gantt

256 views
Skip to first unread message

elton santos

unread,
Jul 26, 2013, 3:24:27 PM7/26/13
to jquer...@googlegroups.com
Hi!

I need help!

I'm use jquery gantt with ruby on rails and i need create dynamically, how i make this? i dont find no one tutorial :/

My code:

$(function() {

"use strict";

<%= raw @alert %>

var today = moment();
var andTwoHours = moment().add("hours",2);

var today_friendly = "/Date(" + today.valueOf() + ")/";
var next_friendly = "/Date(" + andTwoHours.valueOf() + ")/";

//var today_friendly = today.toDate();
//var next_friendly = andTwoHours.toDate();
var maxDate = moment().add("days",10).toDate();

<%= raw @mapa %>

$(".gantt").gantt({
source: [{
name:"Aplicação teste",
values: [{
from: today_friendly,
to: next_friendly,
label:"Teste", 
customClass: "ganttRed"
}]
}],
scale: "hours",
minScale: "hours",
navigate: "scroll",
waitText: "Aguarde...",
dow: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]
});

$(".gantt").popover({
selector: ".bar",
title: "Algum título teste",
content: "Conteúdo teste legal.",
trigger: "hover"
});

console.log(today.format("HH"));

//prettyPrint();

});


I just add other task in gantt, thanks very much!

elton santos

unread,
Jul 29, 2013, 9:17:38 AM7/29/13
to jquer...@googlegroups.com
Someone?
Reply all
Reply to author
Forward
0 new messages