N°3912 - Polishing: Export : fix date entry + size of datatable

This commit is contained in:
acognet
2021-06-21 16:50:19 +02:00
parent 32ac999ff5
commit 1281d475e4
2 changed files with 31 additions and 13 deletions

View File

@@ -26,27 +26,43 @@ var table{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
{% endif %}
drawCallback: function () {
// Hiding pagination if only one page
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2) {
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
{
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').hide();
} else {
}
else
{
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
}
},
createdRow: function( row, data, dataIndex ) {
if (data['@class'] !== undefined) {
createdRow: function (row, data, dataIndex) {
if (data['@class'] !== undefined)
{
$(row).addClass(data['@class']);
}
},
});
if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible')) {
{% if (oUIBlock.GetOption('bFullscreen')) %}
var myheight = $("#ibo-main-content").height()-$("#ibo-main-content")[0].scrollHeight+$("#{{ oUIBlock.GetId() }}").height();
if (myheight < 200)
{
myheight = 200;
};
$("#{{ oUIBlock.GetId() }}_wrapper").find(".dataTables_scrollBody").height(myheight);
{% endif %}
if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible'))
{
table{{ sListIDForVarSuffix }}.columns.adjust().draw();
}
if(window.ResizeObserver){
if (window.ResizeObserver)
{
let oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = null;
const oFromTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function(){
const oFromTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function () {
clearTimeout(oFromTable{{ sListIDForVarSuffix }}ResizeTimeout);
oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function(){
oFromTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function () {
$('#{{ oUIBlock.GetId() }}').DataTable().columns.adjust();
}, 120);
});