63 lines
2.2 KiB
Plaintext
63 lines
2.2 KiB
Plaintext
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_sequencerStatiJS.ascx.cs" Inherits="MoonPro.WebUserControls.mod_sequencerStatiJS" %>
|
|
|
|
<div id="tlArea"></div>
|
|
<asp:HiddenField runat="server" ID="hfNumSplit" />
|
|
<asp:HiddenField runat="server" ID="hfIdxMacc" />
|
|
<asp:HiddenField runat="server" ID="hfDataFrom" />
|
|
<asp:HiddenField runat="server" ID="hfDataTo" />
|
|
|
|
<script type="text/javascript">
|
|
// vedere: http://visjs.org/docs/timeline/
|
|
$(document).ready(reloadData);
|
|
$('<%=hfIdxMacc.UniqueID %>').change(reloadData);
|
|
|
|
// (ri)caricamento dati
|
|
function reloadData() {
|
|
// recupero valori hidden...
|
|
var numSplit = document.getElementById('<%=hfNumSplit.UniqueID.Replace("ctl00$","").Replace("$","_") %>').value;
|
|
var idxMacc = document.getElementById('<%=hfIdxMacc.UniqueID.Replace("ctl00$","").Replace("$","_") %>').value;
|
|
var dataFrom = document.getElementById('<%=hfDataFrom.UniqueID.Replace("ctl00$","").Replace("$","_") %>').value;
|
|
var dataTo = document.getElementById('<%=hfDataTo.UniqueID.Replace("ctl00$","").Replace("$","_") %>').value;
|
|
if (idxMacc != null) {
|
|
// load e draw timeline
|
|
$.ajax({
|
|
type: "GET",
|
|
url: "/WS/MPData.asmx/seqStati?idxMacch=" + idxMacc + "&dataFrom='" + dataFrom + "'&dataTo='" + dataTo+"'&numSPlit=" + numSplit,
|
|
contentType: "application/json; charset=utf-8",
|
|
dataType: "json",
|
|
success: plotSeqStati,
|
|
error: plotSeqStati
|
|
});
|
|
}
|
|
}
|
|
|
|
function plotSeqStati(response) {
|
|
//console.log(response);
|
|
var output = response.responseText.replace("{\"d\":null}", "");
|
|
//console.log(output);
|
|
|
|
// recupero il container grafici
|
|
var container = document.getElementById('tlArea');
|
|
// ITES da deserializzazione risposta
|
|
var items = JSON.parse(output);
|
|
console.log(items);
|
|
// gruppi
|
|
var groups = [
|
|
{
|
|
id: 1
|
|
, content: 'Stati'
|
|
}
|
|
];
|
|
// Configuration for the Timeline
|
|
var options = {
|
|
stack: false
|
|
, horizontalScroll: true
|
|
, moveable: true
|
|
, zoomable: true
|
|
};
|
|
// Crea la Timeline
|
|
var timeline = new vis.Timeline(container, items, groups, options);
|
|
}
|
|
|
|
</script>
|