Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <g:if test="${gnInfo.duration > 0}">
- <g:javascript src="substitution/dhtmlxgantt.js"></g:javascript>
- <link href="${resource(dir: 'css', file: 'dhtmlxgantt.css')}" rel="stylesheet"/>
- <div id="gantt_here" style='width:1100px; height:400px;'></div>
- <script type="text/javascript">
- gantt.config.start_date = "${gnInfo.t0Date.format('yyyy.MM.dd HH:mm')}";
- var dated = new Date("${gnInfo.t0Date.format('yyyy.MM.dd HH:mm')}");
- dated.setTime(dated.getTime() + ${gnInfo.duration}*60*60*1000);
- gantt.config.end_date = dated;
- var tasks = {
- data:[
- {id:1, text:"GN",start_date:"10-10-2010 13:10", duration:1/24,
- progress: 0.6, open: true},
- {id:2, text:"Etape 1", start_date:"10-10-2010 14:10", duration:2/24,
- progress: 1, open: true, parent:1},
- {id:3, text:"Etape 2", start_date:"10-10-2010 15:10", duration:3/24,
- progress: 0.5, open: true, parent:1},
- {id:4, text:"Etape 2.1", start_date:"10-10-2010 16:10", duration:4/24,
- progress: 1, open: true, parent:3},
- {id:5, text:"Etape 2.2", start_date:"10-10-2010 17:10", duration:5/24,
- progress: 0.8, open: true, parent:3},
- {id:6, text:"Etape 2.3", start_date:"10-10-2010 18:10", duration:6/24,
- progress: 0.2, open: true, parent:3}
- ],
- links:[
- {id:1, source:1, target:2, type:"1"},
- {id:2, source:1, target:3, type:"1"},
- {id:3, source:3, target:4, type:"1"},
- {id:4, source:4, target:5, type:"0"},
- {id:5, source:5, target:6, type:"0"}
- ]
- };
- gantt.config.time_step = 1;
- gantt.config.scale_height = 54;
- gantt.config.scale_unit = "day";
- gantt.config.date_scale = "%d-%m-%Y";
- gantt.config.subscales = [
- {unit:"hour", step:1, date:"%H:%i"}
- ];
- gantt.config.lightbox.sections = [
- {name:"description", height:108 , map_to:"text", type:"textarea",focus:true},
- {name:"time", height:72, type:"duration", map_to:"auto", time_format:["%d","%m", "%Y", "%H:%i"]}
- ];
- gantt.init("gantt_here");
- gantt.parse (tasks);
- </script>
- </g:if>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement