update
This commit is contained in:
@@ -3434,6 +3434,34 @@
|
|||||||
$('#micvalue_id').val(id);
|
$('#micvalue_id').val(id);
|
||||||
$('#modaleditormic').modal('show');
|
$('#modaleditormic').modal('show');
|
||||||
}
|
}
|
||||||
|
function reloadAntibioticTablesKeepScroll() {
|
||||||
|
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || 0;
|
||||||
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
|
||||||
|
var tableIds = ['#tblvitek', '#tblkumanmanual1', '#tblkumanmanual2'];
|
||||||
|
var tableCount = 0;
|
||||||
|
|
||||||
|
function restoreScroll() {
|
||||||
|
window.requestAnimationFrame(function () {
|
||||||
|
window.scrollTo(scrollLeft, scrollTop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
tableIds.forEach(function (tableId) {
|
||||||
|
if ( $.fn.DataTable.isDataTable(tableId) ) {
|
||||||
|
tableCount++;
|
||||||
|
$(tableId).DataTable().ajax.reload(function () {
|
||||||
|
tableCount--;
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}
|
||||||
function updateValueManOne(id, value) {
|
function updateValueManOne(id, value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ route("getResult") }}',
|
url: '{{ route("getResult") }}',
|
||||||
@@ -3446,15 +3474,7 @@
|
|||||||
_token: '{{ csrf_token() }}'
|
_token: '{{ csrf_token() }}'
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if ( $.fn.DataTable.isDataTable('#tblvitek') ) {
|
reloadAntibioticTablesKeepScroll();
|
||||||
$("#tblvitek").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual1') ) {
|
|
||||||
$("#tblkumanmanual1").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual2') ) {
|
|
||||||
$("#tblkumanmanual2").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3512,6 +3512,34 @@
|
|||||||
$('#micvalue_id').val(id);
|
$('#micvalue_id').val(id);
|
||||||
$('#modaleditormic').modal('show');
|
$('#modaleditormic').modal('show');
|
||||||
}
|
}
|
||||||
|
function reloadAntibioticTablesKeepScroll() {
|
||||||
|
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || 0;
|
||||||
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
|
||||||
|
var tableIds = ['#tblvitek', '#tblkumanmanual1', '#tblkumanmanual2'];
|
||||||
|
var tableCount = 0;
|
||||||
|
|
||||||
|
function restoreScroll() {
|
||||||
|
window.requestAnimationFrame(function () {
|
||||||
|
window.scrollTo(scrollLeft, scrollTop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
tableIds.forEach(function (tableId) {
|
||||||
|
if ( $.fn.DataTable.isDataTable(tableId) ) {
|
||||||
|
tableCount++;
|
||||||
|
$(tableId).DataTable().ajax.reload(function () {
|
||||||
|
tableCount--;
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}
|
||||||
function updateValueManOne(id, value) {
|
function updateValueManOne(id, value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ route("getResult") }}',
|
url: '{{ route("getResult") }}',
|
||||||
@@ -3524,15 +3552,7 @@
|
|||||||
_token: '{{ csrf_token() }}'
|
_token: '{{ csrf_token() }}'
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if ( $.fn.DataTable.isDataTable('#tblvitek') ) {
|
reloadAntibioticTablesKeepScroll();
|
||||||
$("#tblvitek").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual1') ) {
|
|
||||||
$("#tblkumanmanual1").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual2') ) {
|
|
||||||
$("#tblkumanmanual2").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
console.log("Value updated", res);
|
console.log("Value updated", res);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3547,6 +3547,34 @@
|
|||||||
$('#micvalue_id').val(id);
|
$('#micvalue_id').val(id);
|
||||||
$('#modaleditormic').modal('show');
|
$('#modaleditormic').modal('show');
|
||||||
}
|
}
|
||||||
|
function reloadAntibioticTablesKeepScroll() {
|
||||||
|
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || 0;
|
||||||
|
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
|
||||||
|
var tableIds = ['#tblvitek', '#tblkumanmanual1', '#tblkumanmanual2'];
|
||||||
|
var tableCount = 0;
|
||||||
|
|
||||||
|
function restoreScroll() {
|
||||||
|
window.requestAnimationFrame(function () {
|
||||||
|
window.scrollTo(scrollLeft, scrollTop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
tableIds.forEach(function (tableId) {
|
||||||
|
if ( $.fn.DataTable.isDataTable(tableId) ) {
|
||||||
|
tableCount++;
|
||||||
|
$(tableId).DataTable().ajax.reload(function () {
|
||||||
|
tableCount--;
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (tableCount === 0) {
|
||||||
|
restoreScroll();
|
||||||
|
}
|
||||||
|
}
|
||||||
function updateValueManOne(id, value) {
|
function updateValueManOne(id, value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ route("getResult") }}',
|
url: '{{ route("getResult") }}',
|
||||||
@@ -3559,15 +3587,7 @@
|
|||||||
_token: '{{ csrf_token() }}'
|
_token: '{{ csrf_token() }}'
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if ( $.fn.DataTable.isDataTable('#tblvitek') ) {
|
reloadAntibioticTablesKeepScroll();
|
||||||
$("#tblvitek").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual1') ) {
|
|
||||||
$("#tblkumanmanual1").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
if ( $.fn.DataTable.isDataTable('#tblkumanmanual2') ) {
|
|
||||||
$("#tblkumanmanual2").DataTable().ajax.reload();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user