This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2021-03-09 11:59:23 -07:00
parent e2a0b01d51
commit 930a9c0dad
11 changed files with 351 additions and 208 deletions

View File

@@ -1,7 +1,7 @@
var IHAVEALLTHEPOWER = false;
var objscollapse = null;
var objsexpand = null;
var adscrollerposition =[];
var adscrollerposition = [];
conf = {
error: console.error,
info: console.info,
@@ -78,10 +78,10 @@ function FiltrarTabla(idtxt, idtable, idcontador) {
}
function FiltrarTablaV2(idtxt, idtable, idcontador) {
if ($( idtxt).val() == '') { $(idtable + ' tr').css('display', 'table-row'); }
else { $(idtable + ' tr:not(.ADtr)').css('display', 'none'); $(idtable + ' tr:contains("' + $( idtxt).val() + '")').css('display', 'table-row'); }
if ($(idtxt).val() == '') { $(idtable + ' tr').css('display', 'table-row'); }
else { $(idtable + ' tr:not(.ADtr)').css('display', 'none'); $(idtable + ' tr:contains("' + $(idtxt).val() + '")').css('display', 'table-row'); }
if ($('#' + idcontador).length > 0) {
$('#' + idcontador).html($( idtable + ' tr:visible').length);
$('#' + idcontador).html($(idtable + ' tr:visible').length);
}
}
@@ -354,7 +354,7 @@ function ADScroller2() {
var heightGral = $(window).height() - HeightMenos;
if (Heightfijo > 0) { heightGral = Heightfijo; }
if (widthGral < 300) { widthGral = 300; }
if (heightGral < 300) { heightGral =300; }
if (heightGral < 300) { heightGral = 300; }
widthGral = Tthis.parent().parent().width();
Tthis.removeClass('ADSCROLLER2');
@@ -426,8 +426,8 @@ function ADScroller2() {
var contenedor = $('<div class="ADSContainer" style="width:' + widthGral + 'px;height:' + heightGral + 'px;"></div>');
var divheader = $('<div style="width:' + widthGral + 'px;"></div>');
var divcenter = $('<div style="width:' + widthGral + 'px;"></div>');
var divheader = $('<div class="HeaderContainer" style="width:' + widthGral + 'px;"></div>');
var divcenter = $('<div class="CenterContainer" style="width:' + widthGral + 'px;"></div>');
var divheader1 = $('<div class="AdsCEll" ></div>');
var divheader2 = $('<div class="AdsRHeader"></div>');
var divcenterCols = $('<div class="AdsCHeader"></div>');
@@ -451,6 +451,11 @@ function ADScroller2() {
divheader1.append(THeader1);
var anchoc1 = divheader1.outerWidth();
var divheader1button = $('<div></div>');
divheader1button.width(anchoc1);
divheader1.append(divheader1button);
divheader1button.append(THeader1);
var altoc1 = divheader1.outerHeight() + 15;
divheaderScroll = $('<div class="ADSCroll RHeader" style="width:' + (widthGral - anchoc1) + 'px;"></div>').append(THeader2);
divheader2.append(divheaderScroll);
@@ -483,6 +488,11 @@ function ADScroller2() {
divcolsScroll.unbind('scroll');
});
let sizeoftablefunc = function () {
let widthtx = divheader1.outerWidth() + divheader2.outerWidth();
let widthtxb = divcenterCols.outerWidth() + divcenterbody.outerWidth();
divheader.css('width', widthtx);
divcenter.css('width', widthtx);
let sizetable = Tthis.outerHeight();
if (sizetable < divbodyScroll.height()) {
sizetable = sizetable + 20;
@@ -493,10 +503,11 @@ function ADScroller2() {
};
let resizefncscroller = function () {
var widthGral = $(window).width() - WidthMenos;
//var widthGral = $(window).width() - WidthMenos;
/*console.log(widthGral);*/
contenedor.css('width', 1);
widthGral = Tthis.parent().parent().parent().parent().parent().width();
//contenedor.css('width', 1);
//widthGral = Tthis.parent().parent().parent().parent().parent().width();
widthGral = Tthis.parent().parent().width();
/* console.log(widthGral);*/
var heightGral = $(window).height() - HeightMenos;
//console.log(heightGral);
@@ -510,6 +521,8 @@ function ADScroller2() {
divcolsScroll.css('height', (heightGral - altoc1 + 20));
divbodyScroll.css('width', (widthGral - anchoc1));
divbodyScroll.css('height', (heightGral - altoc1 + 20));
setTimeout(sizeoftablefunc, 100);
};
//$(window).resize(function () {
// setTimeout(resizefncscroller, 50);
@@ -517,14 +530,16 @@ function ADScroller2() {
//});
$('table#ADCol' + Tid + ' tr').hover(
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover');},
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').removeClass('hover');});
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover'); },
function () { $('table#' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').removeClass('hover'); });
$('table#' + Tid + ' tr').hover(
function () { $('table#ADCol' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover');},
function () { $('table#ADCol' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').addClass('hover'); },
function () { $('table#ADCol' + Tid + ' tr:nth-child(' + ($(this).index() + 1) + ')').removeClass('hover'); });
setTimeout(sizeoftablefunc, 100);
Tthis.parent().parent().bind('resize', function () {
setTimeout(resizefncscroller, 100);
})
let found = adscrollerposition.find(element => element.id = 'C_Tab_TabNominas_GvNominas');
if (found != null) {
@@ -784,7 +799,7 @@ function loadadscroll() {
var colVisibles = isNaN(Number(TThis.data('cols'))) ? 0 : Number(TThis.data('cols'));
if (colVisibles > 0) {
if ((Number(TThis.data('heighterror'))) && !(Number(TThis.data('heightmenos')))) { TThis.data('heightmenos', TThis.data('heighterror'));}
if ((Number(TThis.data('heighterror'))) && !(Number(TThis.data('heightmenos')))) { TThis.data('heightmenos', TThis.data('heighterror')); }
TThis.removeClass("ScrollAD");
TThis.addClass("ADSCROLLER2");
} else {
@@ -862,7 +877,7 @@ ADSScroll = function (tablescroll) {
}
}
let firsttr = null;
tablescroll.find('> tbody > tr' + scrollwidthrow + ',> thead > tr' + scrollwidthrow + ',> tr' + scrollwidthrow +'').each(function () {
tablescroll.find('> tbody > tr' + scrollwidthrow + ',> thead > tr' + scrollwidthrow + ',> tr' + scrollwidthrow + '').each(function () {
var retorno = false;
firsttr = $(this);
if (firsttr.find(' > td[colspan], > th[colspan]').length) { retorno = true; }
@@ -1186,7 +1201,7 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) {
Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'),
ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'),
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa')
//Metodo: metodo
};
},