N°3914 - Fix rows selection in the portal's datatables

This commit is contained in:
Molkobain
2021-05-17 13:47:41 +02:00
parent a8ef1c7899
commit 27b930c31c
2 changed files with 7 additions and 7 deletions

View File

@@ -52,7 +52,7 @@
"sortable": false,
"title": "",
"type": "html",
"data": "",
"data": "id",
"render": function(data, type, row){ return '<span class="row_input"><input type="{{ (bMultipleSelect) ? 'checkbox' : 'radio' }}" name="{{ sTargetAttCode }}" /></span>'; }
});
@@ -217,7 +217,7 @@
var aData = oTable.rows(indexes).data().toArray();
// Checking input
$('#{{ sTableId }} tr[role="row"].selected td:first-child input').prop('checked', true);
$('#{{ sTableId }} tr[id].selected td:first-child input').prop('checked', true);
// Saving values in temp array
for(var i in aData)
{
@@ -232,7 +232,7 @@
var aData = oTable.rows(indexes).data().toArray();
// Checking input
$('#{{ sTableId }} tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
$('#{{ sTableId }} tr[id]:not(.selected) td:first-child input').prop('checked', false);
// Saving values in temp array
for(var i in aData)
{

View File

@@ -163,7 +163,7 @@ EOF
"sortable": false,
"title": '{$sSelectionInputGlobalHtml}',
"type": "html",
"data": "",
"data": "id",
"render": function(data, type, row)
{
var oCheckboxElem = $('{$sSelectionInputHtml}');
@@ -261,7 +261,7 @@ EOF
// Handles items selection/deselection
// - Preventing limited access rows to be selected on click
oTable_{$this->oField->GetGlobalId()}.off('user-select').on('user-select', function(oEvent, dt, type, cell, originalEvent){
if($(originalEvent.target).closest('tr[role="row"]').hasClass('limited_access'))
if($(originalEvent.target).closest('tr[id]').hasClass('limited_access'))
{
oEvent.preventDefault();
}
@@ -271,7 +271,7 @@ EOF
var aData = oTable_{$this->oField->GetGlobalId()}.rows(indexes).data().toArray();
// Checking input
$('#{$sTableId} tbody tr[role="row"].selected td:first-child input').prop('checked', true);
$('#{$sTableId} tbody tr[id].selected td:first-child input').prop('checked', true);
// Saving values in temp array
for(var i in aData)
{
@@ -289,7 +289,7 @@ EOF
var aData = oTable_{$this->oField->GetGlobalId()}.rows(indexes).data().toArray();
// Checking input
$('#{$sTableId} tbody tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
$('#{$sTableId} tbody tr[id]:not(.selected) td:first-child input').prop('checked', false);
// Saving values in temp array
for(var i in aData)
{