mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°5335 Disable datatables hyperlinks when rows are selectable
This commit is contained in:
@@ -104,10 +104,14 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
}
|
||||
|
||||
$(this).closest('.dataTables_wrapper').unblock();
|
||||
|
||||
// Disable hyperlinks if necessary
|
||||
{% if oUIBlock.GetOption("disable_hyperlinks") is not same as false %}
|
||||
$("#{{ oUIBlock.GetId() }} a").on('click', function (e) {
|
||||
//disable select action when there is a link
|
||||
e.stopPropagation();
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
},
|
||||
{% else %}
|
||||
drawCallback: function (settings) {
|
||||
@@ -125,6 +129,13 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
||||
}
|
||||
|
||||
// Disable hyperlinks if necessary
|
||||
{% if oUIBlock.GetOption("disable_hyperlinks") is same as true %}
|
||||
$("#{{ oUIBlock.GetId() }} a").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
{% endif %}
|
||||
},
|
||||
{% endif %}
|
||||
rowId: "id",
|
||||
|
||||
@@ -37,6 +37,13 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
||||
}
|
||||
|
||||
// Disable hyperlinks if necessary
|
||||
{% if oUIBlock.GetOption("disable_hyperlinks") is same as true or (oUIBlock.GetOption("select_mode") is not empty and oUIBlock.GetOption("disable_hyperlinks") is not same as false) %}
|
||||
$("#{{ oUIBlock.GetId() }} a").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
{% endif %}
|
||||
},
|
||||
createdRow: function (row, data, dataIndex) {
|
||||
if (data['@class'] !== undefined)
|
||||
|
||||
@@ -73,6 +73,13 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.checkAll')[0].checked = true;
|
||||
}
|
||||
|
||||
// Disable hyperlinks if necessary
|
||||
{% if oUIBlock.GetOption("disable_hyperlinks") is same as true or (oUIBlock.GetOption("select_mode") is not empty and oUIBlock.GetOption("disable_hyperlinks") is not same as false) %}
|
||||
$("#{{ oUIBlock.GetId() }} a").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
{% endif %}
|
||||
},
|
||||
initComplete: function () {
|
||||
if (this.api().page.info().pages < 2)
|
||||
|
||||
Reference in New Issue
Block a user