Este exemplo demonstra todos os eventos expostos pela Linha do tempo.
$render=explode(" ",$_POST['partial_render']);
$render[0]='alerta';
$evento=$_POST['partial_event'];
$detalhe=$_POST['timeline_startDateFirst'].$_POST['timeline_endDateFirst'];
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" 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: 3000,
escape: true,
keepAlive: true,
msgs: [{
summary: "'.$evento.'",
detail: "'.$detalhe.'",
severity: "info",
severityText: "Information"
}]
});
</script>
';
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 3000
, escape: true
, keepAlive: true
, msgs: []
});
dc.cw("Timeline", "widget_form_timeline", {
id: "timeline"
, groups: [{
id: "User 1"
, content: "User 1"
}, {
id: "User 2"
, content: "User 2"
}, {
id: "User 3"
, content: "User 3"
}, {
id: "User 4"
, content: "User 4"
}, {
id: "User 5"
, content: "User 5"
}, {
id: "User 6"
, content: "User 6"
}]
, data: [{
id: "d11579a3\-1451\-4a98\-9261\-87d1ae1bce9c"
, start: new Date('2021-11-11T09:00:00+01:00')
, end: new Date('2021-11-11T14:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 1"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "3ec1b960\-919b\-4685\-b873\-ae062b2f7191"
, start: new Date('2021-11-11T14:00:00+01:00')
, end: new Date('2021-11-11T19:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 1"
, className: "available"
, content: "Disponível"
}, {
id: "f6b12265\-53fe\-4ff6\-9361\-02936a6bb521"
, start: new Date('2021-11-11T20:00:00+01:00')
, end: new Date('2021-11-12T02:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 1"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "07cae037\-a6f6\-4170\-9ff2\-ef4560ae9432"
, start: new Date('2021-11-12T05:00:00+01:00')
, end: new Date('2021-11-12T10:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 1"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "7ae3e73c\-c972\-4c15\-b050\-f7b44a315187"
, start: new Date('2021-11-12T14:00:00+01:00')
, end: new Date('2021-11-12T20:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 1"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "50d52a36\-7bc2\-4164\-803a\-d8254d52b59a"
, start: new Date('2021-11-11T11:00:00+01:00')
, end: new Date('2021-11-11T17:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 2"
, className: "available"
, content: "Disponível"
}, {
id: "e6c86081\-56ed\-4eb0\-9ef1\-b45ee52adbb1"
, start: new Date('2021-11-11T19:00:00+01:00')
, end: new Date('2021-11-11T23:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 2"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "1e050994\-b1dd\-480f\-b45f\-0b02cb9022ea"
, start: new Date('2021-11-12T00:00:00+01:00')
, end: new Date('2021-11-12T05:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 2"
, className: "available"
, content: "Disponível"
}, {
id: "1b7a834e\-cd25\-4d37\-8a6d\-f61319675eeb"
, start: new Date('2021-11-12T08:00:00+01:00')
, end: new Date('2021-11-12T16:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 2"
, className: "available"
, content: "Disponível"
}, {
id: "6ed4fd93\-3e78\-4f8d\-94f2\-d2e353758df2"
, start: new Date('2021-11-12T20:00:00+01:00')
, end: new Date('2021-11-13T05:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 2"
, className: "available"
, content: "Disponível"
}, {
id: "ff7b6165\-b9ac\-4391\-8f4a\-e416162c2266"
, start: new Date('2021-11-11T09:00:00+01:00')
, end: new Date('2021-11-11T15:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 3"
, className: "available"
, content: "Disponível"
}, {
id: "cf85b6e7\-8c57\-41d9\-9a86\-365ac7c813ec"
, start: new Date('2021-11-11T17:00:00+01:00')
, end: new Date('2021-11-11T23:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 3"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "8c2465ae\-782c\-430d\-8ab1\-d38887ae425e"
, start: new Date('2021-11-12T02:00:00+01:00')
, end: new Date('2021-11-12T06:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 3"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "bd7eeb78\-29f5\-4f0e\-87e3\-1934acec5d00"
, start: new Date('2021-11-12T08:00:00+01:00')
, end: new Date('2021-11-12T14:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 3"
, className: "available"
, content: "Disponível"
}, {
id: "07668e76\-1859\-4202\-afad\-880cac7f946c"
, start: new Date('2021-11-12T18:00:00+01:00')
, end: new Date('2021-11-13T00:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 3"
, className: "available"
, content: "Disponível"
}, {
id: "0ae2aef7\-6972\-4752\-b8b3\-42cd1433d75a"
, start: new Date('2021-11-11T11:00:00+01:00')
, end: new Date('2021-11-11T17:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 4"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "600d1b5d\-559b\-4a28\-8b1c\-d86313a76cba"
, start: new Date('2021-11-11T22:00:00+01:00')
, end: new Date('2021-11-12T06:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 4"
, className: "available"
, content: "Disponível"
}, {
id: "d5af89d7\-6176\-4358\-9cf2\-47a45634ddfb"
, start: new Date('2021-11-12T10:00:00+01:00')
, end: new Date('2021-11-12T17:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 4"
, className: "available"
, content: "Disponível"
}, {
id: "b729251d\-bfda\-438d\-8f70\-bcbce03cf759"
, start: new Date('2021-11-12T21:00:00+01:00')
, end: new Date('2021-11-13T02:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 4"
, className: "available"
, content: "Disponível"
}, {
id: "69ab7b5f\-0946\-4fcb\-b18e\-309761319e48"
, start: new Date('2021-11-13T04:00:00+01:00')
, end: new Date('2021-11-13T12:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 4"
, className: "available"
, content: "Disponível"
}, {
id: "4419b21c\-4343\-4413\-a733\-afa4d828c9c0"
, start: new Date('2021-11-11T11:00:00+01:00')
, end: new Date('2021-11-11T16:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 5"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "28f4c983\-3b80\-4a39\-a208\-8a37f46d4741"
, start: new Date('2021-11-11T17:00:00+01:00')
, end: new Date('2021-11-11T22:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 5"
, className: "available"
, content: "Disponível"
}, {
id: "a8401b75\-0e13\-4127\-9453\-f6c19a616620"
, start: new Date('2021-11-12T03:00:00+01:00')
, end: new Date('2021-11-12T12:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 5"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "86f88076\-b36d\-4dc7\-b598\-0b7c4ba43b89"
, start: new Date('2021-11-12T13:00:00+01:00')
, end: new Date('2021-11-12T21:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 5"
, className: "unavailable"
, content: "Indisponível"
}, {
id: "bea87565\-7fa1\-4890\-9ee8\-10083b163536"
, start: new Date('2021-11-13T01:00:00+01:00')
, end: new Date('2021-11-13T07:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 5"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "ef1497aa\-666d\-4fb7\-94b2\-b64e71e907bb"
, start: new Date('2021-11-11T07:00:00+01:00')
, end: new Date('2021-11-11T13:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 6"
, className: "available"
, content: "Disponível"
}, {
id: "8bcf8c45\-8adc\-4f69\-aa3e\-ca1dd2cf2af9"
, start: new Date('2021-11-11T16:00:00+01:00')
, end: new Date('2021-11-11T21:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 6"
, className: "available"
, content: "Disponível"
}, {
id: "0932e976\-3333\-405d\-acca\-76397f566eb0"
, start: new Date('2021-11-12T00:00:00+01:00')
, end: new Date('2021-11-12T04:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 6"
, className: "available"
, content: "Disponível"
}, {
id: "e370e846\-5a1e\-4d7b\-abec\-daa3f5d42dd0"
, start: new Date('2021-11-12T08:00:00+01:00')
, end: new Date('2021-11-12T14:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 6"
, className: "maybe"
, content: "Possivelmente"
}, {
id: "17918223\-2a52\-422d\-8467\-bf804fd0c18a"
, start: new Date('2021-11-12T15:00:00+01:00')
, end: new Date('2021-11-12T23:00:00+01:00')
, editable: {
updateTime: true
, updateGroup: true
, remove: true
}
, group: "User 6"
, className: "maybe"
, content: "Possivelmente"
}]
, currentTime: new Date('2021-11-11T19:06:33.692+01:00')
, preloadFactor: 0.0
, opts: {
autoResize: true
, 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:06:33.691+01:00')
, end: new Date('2021-11-12T03:06:33.691+01:00')
, zoomable: true
, moveable: true
, zoomMin: 10
, zoomMax: 315360000000000
, margin: {
axis: 0
, item: {
horizontal: 10
, vertical: 10
}
}
, groupOrder: "content"
, stack: false
, showCurrentTime: true
, showMajorLabels: true
, showMinorLabels: true
, locale: "pt_BR"
, clickToUse: false
, showTooltips: true
, tooltip: {
followMouse: false
, overflowMethod: 'flip'
, delay: 500
}
}
, behaviors: {
add: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Adcionado"
, f: "formulario"
, p: "timeline"
}, ext);
}
, drop: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Movido"
, f: "formulario"
, p: "timeline"
}, ext);
}
, select: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Selecionado"
, f: "formulario"
, p: "timeline"
}, ext);
}
, rangechanged: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Intervalo alterado"
, f: "formulario"
, p: "timeline"
}, ext);
}
, lazyload: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Carregamento lento"
, f: "formulario"
, p: "timeline"
}, ext);
}
, edit: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Editado"
, f: "formulario"
, p: "timeline"
}, ext);
}
, delete: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Excluido"
, f: "formulario"
, p: "timeline"
}, ext);
}
, changed: function (ext, event) {
dc.ab({
s: "timeline"
, e: "Alterado"
, f: "formulario"
, p: "timeline"
}, ext);
}
}
});