Local
This commit is contained in:
@@ -1,31 +1,38 @@
|
||||
<%@ Page Title="Transportes V&A - Calendario" Language="VB" MasterPageFile="~/Site.master"
|
||||
<%@ Page Title="Transportes V&A - Calendario" Language="VB" MasterPageFile="~/Site.master" EnableEventValidation="false"
|
||||
AutoEventWireup="false" CodeFile="RepContratosCalendario.aspx.vb" Inherits="RepContratosCalendario" %>
|
||||
|
||||
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
|
||||
/* #chartdiv {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
} */
|
||||
|
||||
/*
|
||||
.tipo_vista {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
}
|
||||
}*/
|
||||
|
||||
.my-1 {
|
||||
margin-block: 1rem;
|
||||
}
|
||||
|
||||
.miGrid {
|
||||
/* .miGrid {
|
||||
color: white;
|
||||
}
|
||||
|
||||
}*/
|
||||
/*
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
.fc-month-view .fc-day {
|
||||
/* .fc-month-view .fc-day {
|
||||
border-left: 4px solid #464646;
|
||||
border-right: 4px solid #464646
|
||||
}
|
||||
@@ -36,7 +43,7 @@
|
||||
}
|
||||
.fc-month-view .fc-row.fc-week.fc-widget-content:last-of-type {
|
||||
border-bottom: 4px solid #464646!important;
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +60,7 @@
|
||||
<style>
|
||||
.gantt-samples-banner_controls_bar.controls_bar {
|
||||
margin: 0;
|
||||
//position: absolute;
|
||||
/*position: absolute;*/
|
||||
top: -30px;
|
||||
width: 100%;
|
||||
right: 0;
|
||||
@@ -83,11 +90,21 @@
|
||||
}
|
||||
|
||||
#gantt_here {
|
||||
scroll-behavior: smooth; /* Aplica un desplazamiento suave */
|
||||
overflow-y: auto; /* Asegura que el desplazamiento vertical esté activo */
|
||||
}
|
||||
|
||||
width: 100%; /* El ancho será el 100% del contenedor padre */
|
||||
height: 400px; /* Puedes ajustar esta altura según necesites */
|
||||
border: 1px solid #ccc; /* Opcional: Un borde para visualizar mejor el área del Gantt */
|
||||
box-sizing: border-box; /* Asegura que el padding y el borde no afecten el tamaño total */
|
||||
|
||||
}
|
||||
|
||||
|
||||
.gantt_parent_task {
|
||||
background-color: #ffcccc !important; /* Color para las tareas principales */
|
||||
}
|
||||
|
||||
.gantt_child_task {
|
||||
background-color: #cce5ff !important; /* Color para las sub-tareas */
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="/Metronic/assets/global/plugins/dhtmlxgantt/dhtmlxgantt.css" type="text/css">
|
||||
@@ -99,12 +116,21 @@
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPdf" />
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="C" runat="Server">
|
||||
@@ -356,11 +382,35 @@
|
||||
<ajax:TabPanel ID="TabGrantt" runat="server" HeaderText="Cronograma">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="height: 32px;">
|
||||
<label class="col-md-1 truncate">Tipo Vista:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoVistaCalendario" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoVistaCalendario_SelectedIndexChanged" CssClass="form-control select2me input-sm select2me Widthall"
|
||||
Style="width: 100%;" runat="server">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Solo Viaje" Value="1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPGat" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div>
|
||||
<div class="gantt-samples-banner_controls_bar controls_bar">
|
||||
<div style="display:none">
|
||||
<div class="gantt-samples-banner_controls_bar controls_bar" style="display:none!important">
|
||||
|
||||
<strong>Formato: </strong>
|
||||
<label>
|
||||
@@ -403,7 +453,7 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gantt_here" style='width: 100%; height: 100vh;'></div>
|
||||
<div id="gantt_here"></div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -412,7 +462,7 @@
|
||||
|
||||
<asp:UpdatePanel ID="UPPGantt" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="display:none!important">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
@@ -433,6 +483,7 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="chartdiv"></div>
|
||||
@@ -716,10 +767,258 @@
|
||||
"December": "Diciembre",
|
||||
|
||||
};
|
||||
var dateAxis;
|
||||
let dateAxis;
|
||||
let yAxis;
|
||||
|
||||
function cargaDiagramaGrant(data, categorias, TipoVista) {
|
||||
|
||||
am5.ready(function () {
|
||||
// SI YA HAY GRÁFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA
|
||||
root.container.children.clear();
|
||||
|
||||
root.dateFormatter.setAll({
|
||||
dateFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
dateFields: ["valueX", "openValueX"]
|
||||
});
|
||||
|
||||
root.locale = am5locales_es_ES;
|
||||
|
||||
// Establecer temas
|
||||
root.setThemes([
|
||||
am5themes_Animated.new(root)
|
||||
]);
|
||||
|
||||
// Crear gráfico
|
||||
let chart = root.container.children.push(am5xy.XYChart.new(root, {
|
||||
panX: false,
|
||||
panY: false, // Habilita el desplazamiento vertical
|
||||
wheelX: "none",
|
||||
wheelY: "none", // Habilita el scroll vertical con la rueda del mouse
|
||||
layout: root.verticalLayout,
|
||||
paddingLeft: 0
|
||||
}));
|
||||
|
||||
|
||||
// Deshabilitar el enmascaramiento en el plotContainer
|
||||
//chart.plotContainer.set("mask", null); // quita rendimiento
|
||||
|
||||
// Agregar leyenda
|
||||
let legend = chart.children.push(am5.Legend.new(root, {
|
||||
centerX: am5.p50,
|
||||
x: am5.p50
|
||||
}));
|
||||
|
||||
let colors = chart.get("colors");
|
||||
|
||||
// Definir cellSize para el tamaño fijo de cada categoría en el eje Y
|
||||
let cellSize = 45;
|
||||
|
||||
//if (TipoVista == 1) {
|
||||
// cellSize = 60;
|
||||
//}
|
||||
|
||||
// Crear eje Y (CategoryAxis)
|
||||
chart.paddingTop = 40;
|
||||
|
||||
yAxis = chart.yAxes.push(
|
||||
am5xy.CategoryAxis.new(root, {
|
||||
categoryField: "category",
|
||||
renderer: am5xy.AxisRendererY.new(root, {
|
||||
inversed: false,
|
||||
minGridDistance: cellSize, // Asigna el tamaño fijo a cada unidad
|
||||
minorGridEnabled: true,
|
||||
neverHide: true,
|
||||
forceHidden: false,
|
||||
oversizedBehavior: "none",
|
||||
location: 0.5,
|
||||
fontSize: 12, // Ajusta el tamaño de fuente si es necesario
|
||||
visible: true, // Asegura que las etiquetas sean visibles
|
||||
minPosition: 0.001,
|
||||
maxPosition: 0.999,
|
||||
minGridDistance: 1, // Reduced from cellSize to 1
|
||||
}),
|
||||
tooltip: am5.Tooltip.new(root, {
|
||||
themeTags: ["axis"],
|
||||
animationDuration: 200
|
||||
})
|
||||
})
|
||||
);
|
||||
|
||||
//yAxis.renderer.grid.template.disabled = !showgrid;
|
||||
//yAxis.paddingLeft = 10;
|
||||
//yAxis.paddingRight = 10;
|
||||
//yAxis.layout = "absolute";
|
||||
|
||||
// Set up axis title
|
||||
//yAxis.title.text = "Unidades";
|
||||
//yAxis.title.rotation = 0;
|
||||
//yAxis.title.align = "center";
|
||||
//yAxis.title.valign = "top";
|
||||
|
||||
yAxis.set('strictMinMax', true);
|
||||
yAxis.set('maxDeviation', 0);
|
||||
yAxis.set('start', 0);
|
||||
yAxis.set('end', 1);
|
||||
|
||||
yAxis.data.setAll(categorias);
|
||||
|
||||
// Asegurar que las etiquetas del eje Y siempre se muestren
|
||||
//yAxis.get("renderer").labels.template.setAll({
|
||||
// forceHidden: false,
|
||||
// oversizedBehavior: "none",
|
||||
// location: 0.5,
|
||||
// fontSize: 12, // Ajusta el tamaño de fuente si es necesario
|
||||
// visible: true, // Asegura que las etiquetas sean visibles
|
||||
// minPosition: 0.001,
|
||||
// maxPosition: 0.999
|
||||
//});
|
||||
|
||||
// Configurar el eje Y para evitar zoom automático
|
||||
|
||||
|
||||
// Obtener valores de las cajas de texto
|
||||
let fechaI = document.getElementById('<%= txtFechaI.ClientID %>').value;
|
||||
let fechaF = document.getElementById('<%= txtFechaF.ClientID %>').value;
|
||||
|
||||
// Convertir valores a objetos Date
|
||||
let minDate = new Date(fechaI.split("/").reverse().join("-"));
|
||||
let maxDate = new Date(fechaF.split("/").reverse().join("-"));
|
||||
maxDate.setHours(23, 59, 59, 999);
|
||||
|
||||
|
||||
|
||||
// Crear eje X (DateAxis)
|
||||
let xAxis = am5xy.DateAxis.new(root, {
|
||||
baseInterval: { timeUnit: "hour", count: 1 },
|
||||
renderer: am5xy.AxisRendererX.new(root, {
|
||||
opposite: true,
|
||||
minorGridEnabled: true,
|
||||
minGridDistance: 50 // Ajusta según sea necesario para evitar superposición
|
||||
}),
|
||||
min: minDate.getTime(),
|
||||
max: maxDate.getTime(),
|
||||
groupData: false,
|
||||
markUnitChange: false
|
||||
});
|
||||
|
||||
// Agregar el eje X al contenedor superior
|
||||
chart.topAxesContainer.children.push(xAxis);
|
||||
|
||||
// Asegurar que todas las etiquetas se muestren
|
||||
xAxis.get("renderer").labels.template.setAll({
|
||||
forceHidden: false,
|
||||
minPosition: 0.001,
|
||||
maxPosition: 0.999,
|
||||
location: 0.5,
|
||||
fontSize: 14, // Tamaño de fuente
|
||||
fontWeight: "bold"
|
||||
});
|
||||
|
||||
// Formatear las etiquetas de fecha
|
||||
xAxis.get("renderer").labels.template.adapters.add("text", function (text, target) {
|
||||
let dataItem = target.dataItem;
|
||||
if (dataItem) {
|
||||
let value = dataItem.get('value');
|
||||
let date = new Date(value);
|
||||
let day = date.getDate().toString().padStart(2, '0');
|
||||
let month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
return day + '/' + month;
|
||||
} else {
|
||||
return text;
|
||||
}
|
||||
});
|
||||
|
||||
// Añadir la serie
|
||||
let series = chart.series.push(am5xy.ColumnSeries.new(root, {
|
||||
xAxis: xAxis,
|
||||
yAxis: yAxis,
|
||||
openValueXField: "fromDate",
|
||||
valueXField: "toDate",
|
||||
categoryYField: "category"
|
||||
/*, sequencedInterpolation: true*/
|
||||
}));
|
||||
|
||||
series.columns.template.setAll({
|
||||
templateField: "columnSettings",
|
||||
strokeOpacity: 0,
|
||||
tooltipText: "UNIDAD: {category}-{unidad} \nCONTRATO: {contrato} \nDURACIÓN: {openValueX} - {valueX}"
|
||||
});
|
||||
|
||||
series.data.processor = am5.DataProcessor.new(root, {
|
||||
dateFields: ["fromDate", "toDate"],
|
||||
dateFormat: "yyyy-MM-dd HH:mm:ss"
|
||||
});
|
||||
|
||||
series.data.setAll(data);
|
||||
|
||||
//// Scrollbar X
|
||||
//var scrollbarX = am5.Scrollbar.new(root, {
|
||||
// orientation: "horizontal"
|
||||
//});
|
||||
|
||||
//chart.set("scrollbarX", scrollbarX);
|
||||
//chart.bottomAxesContainer.children.push(scrollbarX);
|
||||
|
||||
// Scrollbar Y
|
||||
//let scrollbarY = am5.Scrollbar.new(root, {
|
||||
// orientation: "vertical"
|
||||
//});
|
||||
|
||||
//chart.set("scrollbarY", scrollbarY);
|
||||
//chart.rightAxesContainer.children.push(scrollbarY);
|
||||
|
||||
// MOSTRAR MODAL DE CONTRATO AL HACER CLICK
|
||||
series.columns.template.events.on("click", e => {
|
||||
let cveContrato = e.target.dataItem.dataContext.cveContrato;
|
||||
|
||||
$('#<%=HdnCveContrato.ClientID%>').val(cveContrato);
|
||||
|
||||
let url = '/Ashx/CargaEventos.ashx?METODO=contrato_transportes';
|
||||
let parametros = '&cveContrato=' + cveContrato + '&U=' + '<%= UsuarioActual.CveUsuario %>' + '&E=' + '<%= UsuarioActual.CveEmpresa %>' + '&tipoVista=' + '<%= RBTipoVista.Text %>' + '&CveUsuarioPara:' + $('#DdlTecnico').val() + '&CveSubProyecto:' + $('#DdlSubProyecto').val();
|
||||
|
||||
fetch(url + parametros).then(response => response.json()).then(json => {
|
||||
updateEvent(json[0], null, false);
|
||||
}).catch(err => console.log('Solicitud fallida', err));
|
||||
});
|
||||
|
||||
|
||||
|
||||
series.events.on("datavalidated", function (ev) {
|
||||
|
||||
let xAxisHeight = xAxis.height();
|
||||
let chartHeight = categorias.length * cellSize + xAxisHeight + chart.get("paddingTop", 0) + chart.get("paddingBottom", 0);
|
||||
|
||||
// Establece la altura calculada en el contenedor del gráfico
|
||||
chart.root.dom.style.height = chartHeight + "px";
|
||||
|
||||
// Asegurar que el eje Y no esté con zoom
|
||||
yAxis.zoom(0, 1);
|
||||
});
|
||||
|
||||
// Animaciones al cargar
|
||||
series.appear();
|
||||
chart.appear(1000, 100);
|
||||
|
||||
}); // end am5.ready()
|
||||
}
|
||||
|
||||
function zoomAxisy(inicio,fin) {
|
||||
setTimeout(() => {
|
||||
//yAxis.zoomToIndexes(inicio, fin);
|
||||
}, 100);
|
||||
|
||||
}
|
||||
function zoomAxis(anioI, mesI, diaI, anioF, mesF, diaF) {
|
||||
setTimeout(() => {
|
||||
// dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
|
||||
}, 1500);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
<%--function cargaDiagramaGrant(data, categorias, TipoVista) {
|
||||
|
||||
am5.ready(function () {
|
||||
//SI YA HAY GRAFICA, QUITA LA ACTUAL PARA HACER UNA NUEVA
|
||||
root.container.children.clear();
|
||||
@@ -740,10 +1039,10 @@
|
||||
// Create chart
|
||||
// https://www.amcharts.com/docs/v5/charts/xy-chart/
|
||||
var chart = root.container.children.push(am5xy.XYChart.new(root, {
|
||||
panX: true,
|
||||
panX: false,
|
||||
panY: false,
|
||||
wheelX: "panX",
|
||||
wheelY: "zoomX",
|
||||
wheelX: "none",
|
||||
wheelY: "none",
|
||||
layout: root.verticalLayout,
|
||||
paddingLeft: 0
|
||||
}));
|
||||
@@ -783,23 +1082,46 @@
|
||||
var minDate = new Date(fechaI.split("/").reverse().join("-"));
|
||||
var maxDate = new Date(fechaF.split("/").reverse().join("-"));
|
||||
|
||||
dateAxis = am5xy.DateAxis.new(root, {
|
||||
baseInterval: { timeUnit: "day", count: 1 },
|
||||
renderer: am5xy.AxisRendererX.new(root, {
|
||||
minorGridEnabled: true,
|
||||
minGridDistance: 90
|
||||
}),
|
||||
min: minDate.getTime(),
|
||||
max: maxDate.getTime()
|
||||
//min: new Date(2024, 6, 15).getTime(),
|
||||
//max: new Date(2024, 6, 31).getTime()
|
||||
|
||||
var xAxis = chart.xAxes.push(
|
||||
am5xy.DateAxis.new(root, {
|
||||
baseInterval: { timeUnit: "day", count: 1 },
|
||||
renderer: am5xy.AxisRendererX.new(root, {
|
||||
opposite: true,
|
||||
minorGridEnabled: true,
|
||||
minGridDistance: 30 // Ajusta según sea necesario
|
||||
}),
|
||||
min: minDate.getTime(),
|
||||
max: maxDate.getTime(),
|
||||
groupData: false,
|
||||
markUnitChange: false
|
||||
})
|
||||
);
|
||||
|
||||
// Asegurar que todas las etiquetas se muestren
|
||||
xAxis.get("renderer").labels.template.setAll({
|
||||
forceHidden: false,
|
||||
minPosition: 0.001,
|
||||
maxPosition: 0.999,
|
||||
location: 0.5 // Centra las etiquetas
|
||||
});
|
||||
|
||||
var xAxis = chart.xAxes.push(
|
||||
dateAxis
|
||||
);
|
||||
|
||||
chart.topAxesContainer.children.push(dateAxis);
|
||||
// Formatear las etiquetas de fecha
|
||||
xAxis.get("renderer").labels.template.adapters.add("text", function (text, target) {
|
||||
var dataItem = target.dataItem;
|
||||
if (dataItem) {
|
||||
var value = dataItem.get('value');
|
||||
var date = new Date(value);
|
||||
var day = date.getDate().toString().padStart(2, '0');
|
||||
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
return day + '/' + month;
|
||||
} else {
|
||||
return text; // O puedes devolver una cadena vacía: return '';
|
||||
}
|
||||
});
|
||||
|
||||
//chart.topAxesContainer.children.push(dateAxis);
|
||||
|
||||
// Add series
|
||||
// https://www.amcharts.com/docs/v5/charts/xy-chart/series/
|
||||
@@ -812,6 +1134,7 @@
|
||||
sequencedInterpolation: true
|
||||
}));
|
||||
|
||||
|
||||
series.columns.template.setAll({
|
||||
templateField: "columnSettings",
|
||||
strokeOpacity: 0,
|
||||
@@ -824,11 +1147,7 @@
|
||||
});
|
||||
series.data.setAll(data);
|
||||
|
||||
// Add scrollbars
|
||||
//chart.set("scrollbarX", am5.Scrollbar.new(root, {
|
||||
// orientation: "horizontal"
|
||||
//}));
|
||||
|
||||
|
||||
// Scrollbar X
|
||||
var scrollbarX = am5.Scrollbar.new(root, {
|
||||
orientation: "horizontal"
|
||||
@@ -884,14 +1203,9 @@
|
||||
|
||||
|
||||
}); // end am5.ready()
|
||||
}
|
||||
}--%>
|
||||
|
||||
function zoomAxis(anioI, mesI, diaI, anioF, mesF, diaF) {
|
||||
setTimeout(() => {
|
||||
dateAxis.zoomToDates(new Date(anioI, mesI, diaI), new Date(anioF, mesF, diaF));
|
||||
}, 1500);
|
||||
|
||||
}
|
||||
|
||||
|
||||
var PrimeraCargaCalendario = true;
|
||||
var currentUpdateEvent;
|
||||
@@ -1332,22 +1646,22 @@
|
||||
var datosGant = [];
|
||||
function loadGant() {
|
||||
gantt.config.date_format = "%Y-%m-%d %H:%i";
|
||||
gantt.config.order_branch = true;
|
||||
gantt.i18n.setLocale("es");
|
||||
gantt.init("gantt_here");
|
||||
|
||||
gantt.config.order_branch = true;
|
||||
gantt.config.order_branch_free = true;
|
||||
gantt.config.open_tree_initially = true;
|
||||
gantt.config.show_tasks_outside_timescale = true;
|
||||
gantt.config.drag_move = false; // Desactiva mover tareas
|
||||
gantt.config.drag_resize = false; // Desactiva redimensionar tareas
|
||||
gantt.config.drag_progress = false; // Desactiva mover la barra de progreso
|
||||
|
||||
//gantt.config.smart_scales = false;// Desactiva el salto automático entre escalas de tiempo
|
||||
//gantt.config.scroll_size = 1;
|
||||
// gantt.config.scroll_on_click = false; // Desactiva el scroll automático al hacer clic
|
||||
//gantt.config.autosize = "xy";
|
||||
//gantt.config.smart_rendering = false;
|
||||
gantt.i18n.setLocale("es");
|
||||
gantt.init("gantt_here");
|
||||
|
||||
|
||||
|
||||
gantt.config.columns = [
|
||||
//{ name: "text", label: "Contrato ", width: "*", min_width: 150, tree: true, resize: true, template: function (obj) { return "<a href=\"/Transportes/RepContratoDetalle.aspx?CveContrato=" + obj.id + "\" target=\"_Blank\">" + obj.text + " </a>" } },
|
||||
{ name: "codigoaf", label: "Unidad", max_width: 50, align: "left" },
|
||||
//{ name: "start_date", label: "Inicio", min_width: 90, align: "center" },
|
||||
//{ name: "end_date", label: "Fin", min_width: 90, align: "center" }
|
||||
|
||||
@@ -1362,10 +1676,13 @@
|
||||
data: datosGant
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Agregar evento para hover y mostrar tooltip
|
||||
gantt.attachEvent("onMouseMove", function (id, e) {
|
||||
if (id) {
|
||||
var task = gantt.getTask(id);
|
||||
var task = gantt.getTask(id);
|
||||
|
||||
// Mostrar el tooltip burbuja
|
||||
var tooltip = document.getElementById("gantt_tooltip");
|
||||
@@ -1401,36 +1718,34 @@
|
||||
// Cancelar el comportamiento predeterminado
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
gantt.attachEvent("onBeforeTaskMove", function (id, parent, tindex) {
|
||||
console.log(tindex)
|
||||
var task = gantt.getTask(id);
|
||||
if (task.parent != parent)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
gantt.attachEvent("onRowDragEnd", function (id, target, tindex) {
|
||||
console.log(tindex)
|
||||
debugger;
|
||||
drag_id = null;
|
||||
gantt.render();
|
||||
});
|
||||
|
||||
gantt.attachEvent("onTaskLoading", function (task) {
|
||||
if (task.hidden) {
|
||||
task.$rendered = false; // Evitar que la tarea se renderice
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
gantt.attachEvent("onBeforeTaskMove", function (id, parent, tindex) {
|
||||
console.log(tindex)
|
||||
var task = gantt.getTask(id);
|
||||
if (task.parent != parent)
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
gantt.attachEvent("onRowDragEnd", function (id, target, tindex) {
|
||||
console.log(tindex)
|
||||
debugger;
|
||||
drag_id = null;
|
||||
gantt.render();
|
||||
});
|
||||
|
||||
gantt.attachEvent("onGanttScroll", function (left, top) {
|
||||
|
||||
// var step = 50; // Define cuánto avanzar con cada paso del scroll
|
||||
//var newTop = top + step; // Incrementa el scroll vertical en 50 píxeles
|
||||
|
||||
//gantt.scrollTo(left, newTop); // Establece el nuevo valor de scroll vertical
|
||||
console.log("Scroll vertical: ", top);
|
||||
return false; // Previene el scroll predeterminado para que solo se aplique el manual
|
||||
|
||||
|
||||
//return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
loadGant();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user