mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Fix tooltips in datatables and add events to datatables init and draw actions
This commit is contained in:
@@ -450,9 +450,17 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
|
|||||||
$oAttachmentTableBlock = DataTableUIBlockFactory::MakeForStaticData('', $aAttribs, $aData);
|
$oAttachmentTableBlock = DataTableUIBlockFactory::MakeForStaticData('', $aAttribs, $aData);
|
||||||
$oAttachmentTableBlock->AddCSSClass('ibo-attachment--datatable');
|
$oAttachmentTableBlock->AddCSSClass('ibo-attachment--datatable');
|
||||||
$this->oPage->AddUiBlock($oAttachmentTableBlock);
|
$this->oPage->AddUiBlock($oAttachmentTableBlock);
|
||||||
foreach ($aData as $aRow) {
|
|
||||||
$this->oPage->add_ready_script($aRow['js']);
|
$sTableId = $oAttachmentTableBlock->GetId();
|
||||||
}
|
$this->oPage->add_script(
|
||||||
|
<<<JS
|
||||||
|
$('#$sTableId').on('inited drawn', function(){
|
||||||
|
$('#$sTableId [data-tooltip-content]').each(function(){
|
||||||
|
CombodoGlobalToolbox.InitTooltipFromMarkup($(this), true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
JS
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -541,7 +549,6 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
|
|||||||
'upload-date' => $sAttachmentDateFormatted,
|
'upload-date' => $sAttachmentDateFormatted,
|
||||||
'uploader' => $sAttachmentUploader,
|
'uploader' => $sAttachmentUploader,
|
||||||
'type' => $sFileType,
|
'type' => $sFileType,
|
||||||
'js' => 'CombodoGlobalToolbox.InitTooltipFromMarkup($("#$sTrId [data-tooltip-content]"));',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($bWithDeleteButton)
|
if ($bWithDeleteButton)
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
|||||||
{
|
{
|
||||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
||||||
}
|
}
|
||||||
|
$('#{{ oUIBlock.GetId() }}').trigger('drawn');
|
||||||
},
|
},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
rowId: "id",
|
rowId: "id",
|
||||||
@@ -183,6 +184,7 @@ var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
|||||||
this.parent().find('.dataTables_paginate').hide();
|
this.parent().find('.dataTables_paginate').hide();
|
||||||
this.parent().find('.dataTables_length').hide();
|
this.parent().find('.dataTables_length').hide();
|
||||||
}
|
}
|
||||||
|
$('#{{ oUIBlock.GetId() }}').trigger('inited');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -46,5 +46,11 @@ $('#{{ oUIBlock.GetId() }}').DataTable({
|
|||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
],
|
||||||
|
initComplete: function () {
|
||||||
|
$('#{{ oUIBlock.GetId() }}').trigger('inited');
|
||||||
|
},
|
||||||
|
drawCallback: function(){
|
||||||
|
$('#{{ oUIBlock.GetId() }}').trigger('drawn');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user