Arraste os eventos da lista do lado esquerdo e solte-os na linha do tempo.
$render=explode(" ", $_POST["partial_render"]);
$dragId=explode(":",$_POST["timeline_dragId"]);
$resposta="
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: [{
summary: "O Evento ".$dragId[0]." foi adicionado"
, detail: ""
, severity: "info"
, severityText: "Information"
}]
});
</script>
";
$resposta1="
<div id="eventsList" class="ui-datalist ui-widget">
<div id="eventsList_content" class="ui-datalist-content ui-widget-content">
<ul id="eventsList_list" class="ui-datalist-data" type="circle">";
for ($i = 1; $i <= 10; $i++) {
$resposta1.="
<li class="ui-datalist-item">
<div id="".$i.":eventBox" class="ui-outputpanel ui-widget p-p-2" style="z-index:9999; cursor:move;">
Event ".$i."
</div>
<div id="eventsList:".$i."" style="display: none;"></div>
<script id="eventsList:".$i."_s" type="text/javascript">
DinarteCoelho.cw("Draggable", "widget_eventsList_".$i."", {
id: "eventsList:".$i."",
target: "".$i.":eventBox",
cursor: "move",
helper: "clone",
revert: "invalid"
});
</script>
</li>";
}
$resposta1.="
</ul>
</div>
</div>
<script id="eventsList_s" type="text/javascript">
DinarteCoelho.cw("DataList", "widget_eventsList", {
id: "eventsList"
});
</script>
";
$inicio=explode(".",$_POST["timeline_startDate"]);
$hinicio= explode("T",$inicio[0]);
$fim= explode(".",$_POST["timeline_endDate"]);
$hfim= explode("T",$fim[0]);
$eval=";DC("widget_timeline").addEvent({id: "".rand(100000,999999)."", start: new Date(".$inicio[0]."), end: new Date(".$fim[0]."), editable: {updateTime: false,updateGroup: false,remove: false}, group: null, className: null, content:"<table>\n<tbody>\n<tr>\n<td>Evento ".$dragId[0]."<\/td>\n<\/tr>\n<tr>\n<td>".$hinicio[1]."<\/td>\n<\/tr>\n<tr>\n<td>".$hfim[1]."<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n"});DC("widget_timeline").renderTimeline();";
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("Draggable", "widget_eventsList", {
id: "eventsList"
, target: "eventBox"
, cursor: "move"
, helper: "clone"
, revert: "invalid"
});
dc.cw("DataList", "widget_eventsList", {
id: "eventsList"
});
dc.cw("Timeline", "widget_timeline", {
id: "timeline"
, data: []
, currentTime: new Date('2021-11-11T19:23:29.893+01:00')
, preloadFactor: 0.0
, hoverClass: "ui\-state\-hover"
, activeClass: "ui\-state\-highlight"
, opts: {
autoResize: true
, minHeight: 400
, width: "100%"
, orientation: {
axis: 'bottom'
, item: 'bottom'
}
, editable: {
add: true
, remove: true
, updateTime: true
, updateGroup: true
, overrideItems: false
}
, selectable: true
, start: new Date('2021-11-11T15:23:29.893+01:00')
, end: new Date('2021-11-12T03:23:29.893+01:00')
, zoomable: true
, moveable: true
, zoomMin: 10
, zoomMax: 315360000000000
, margin: {
axis: 0
, item: {
horizontal: 10
, vertical: 10
}
}
, groupOrder: "content"
, stack: true
, showCurrentTime: true
, showMajorLabels: true
, showMinorLabels: true
, locale: "pt_BR"
, clickToUse: false
, showTooltips: true
, tooltip: {
followMouse: false
, overflowMethod: 'flip'
, delay: 500
}
}
, behaviors: {
drop: function (ext, event) {
dc.ab({
s: "timeline"
, e: "drop"
, f: "formulario"
, p: "timeline"
, u: "alerta eventsList"
, g: false
}, ext);
}
}
});