mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 21:48:45 +02:00
N°3634 - Feedback alpha 3.0 : finish list
This commit is contained in:
@@ -133,9 +133,15 @@ $ibo-datatable--selection-validation-buttons-toolbar--margin-top: 10px !default;
|
|||||||
@extend %ibo-font-ral-med-100;
|
@extend %ibo-font-ral-med-100;
|
||||||
color: $ibo-datatable--paginate-button--link--color;
|
color: $ibo-datatable--paginate-button--link--color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.paginate_button a:hover {
|
.paginate_button a:hover {
|
||||||
color: $ibo-datatable--paginate-button--link--hover--color;
|
color: $ibo-datatable--paginate-button--link--hover--color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.paginate_button.disabled a:hover {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
.paginate_button.active a {
|
.paginate_button.active a {
|
||||||
@extend %ibo-font-ral-med-100;
|
@extend %ibo-font-ral-med-100;
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,16 @@ $ibo-field--value--padding-bottom--is-fullscreen: $ibo-field--label--padding-y--
|
|||||||
display: table-cell;
|
display: table-cell;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
||||||
|
> input[type="checkbox"] {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.multi_values, .mono_value {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
/* Fullscreen mode */
|
/* Fullscreen mode */
|
||||||
.ibo-field-large {
|
.ibo-field-large {
|
||||||
&.ibo-is-fullscreen {
|
&.ibo-is-fullscreen {
|
||||||
|
|||||||
@@ -429,15 +429,16 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
|
|||||||
'type' => array('label' => $sFileType, 'description' => $sFileType),
|
'type' => array('label' => $sFileType, 'description' => $sFileType),
|
||||||
);
|
);
|
||||||
|
|
||||||
if($bWithDeleteButton)
|
if ($bWithDeleteButton) {
|
||||||
{
|
|
||||||
$aAttribs['delete'] = array('label' => '', 'description' => '');
|
$aAttribs['delete'] = array('label' => '', 'description' => '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -525,7 +526,8 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
|
|||||||
'formatted-size' => $sFileFormattedSize,
|
'formatted-size' => $sFileFormattedSize,
|
||||||
'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)
|
||||||
@@ -536,11 +538,7 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
|
|||||||
$this->oPage->add_ready_script($oBlockRenderer->RenderJsInline($sDeleteButton::ENUM_JS_TYPE_ON_INIT));
|
$this->oPage->add_ready_script($oBlockRenderer->RenderJsInline($sDeleteButton::ENUM_JS_TYPE_ON_INIT));
|
||||||
$aAttachmentLine['delete'] = $oBlockRenderer->RenderHtml();
|
$aAttachmentLine['delete'] = $oBlockRenderer->RenderHtml();
|
||||||
}
|
}
|
||||||
$this->oPage->add_ready_script(
|
|
||||||
<<<JS
|
|
||||||
CombodoGlobalToolbox.InitTooltipFromMarkup($('#$sTrId [data-tooltip-content]'));
|
|
||||||
JS
|
|
||||||
);
|
|
||||||
return $aAttachmentLine;
|
return $aAttachmentLine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,32 +25,36 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
|||||||
var requestStart = request.start;
|
var requestStart = request.start;
|
||||||
var drawStart = request.start;
|
var drawStart = request.start;
|
||||||
var requestLength = request.length;
|
var requestLength = request.length;
|
||||||
if(request.start=undefined)
|
if (request.start = undefined) {
|
||||||
{
|
|
||||||
requestStart = settings._iDisplayStart;
|
requestStart = settings._iDisplayStart;
|
||||||
drawStart = settings._iDisplayStart;
|
drawStart = settings._iDisplayStart;
|
||||||
requestLength = settings._iDisplayLength;
|
requestLength = settings._iDisplayLength;
|
||||||
}
|
}
|
||||||
var requestEnd = requestStart + requestLength;
|
var requestEnd = requestStart+requestLength;
|
||||||
|
|
||||||
if ( settings.clearCache ) {
|
//Manage case requestLength=-1 => all the row are display
|
||||||
|
if (requestLength == -1) {
|
||||||
|
requestLength = cacheLastJson.recordsTotal;
|
||||||
|
if (cacheLower != 0 || cacheLastJson.recordsTotal > cacheUpper) {
|
||||||
|
//new server request is mandatory
|
||||||
|
ajax = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.clearCache) {
|
||||||
// API requested that the cache be cleared
|
// API requested that the cache be cleared
|
||||||
ajax = true;
|
ajax = true;
|
||||||
settings.clearCache = false;
|
settings.clearCache = false;
|
||||||
}
|
} else if (cacheLower < 0 || requestStart < cacheLower || requestEnd > cacheUpper) {
|
||||||
else if ( cacheLower < 0 || requestStart < cacheLower || requestEnd > cacheUpper ) {
|
|
||||||
// outside cached data - need to make a request
|
// outside cached data - need to make a request
|
||||||
ajax = true;
|
ajax = true;
|
||||||
}
|
} else if (JSON.stringify(request.order) !== JSON.stringify(cacheLastRequest.order) ||
|
||||||
else if ( JSON.stringify( request.order ) !== JSON.stringify( cacheLastRequest.order ) ||
|
JSON.stringify(request.columns) !== JSON.stringify(cacheLastRequest.columns) ||
|
||||||
JSON.stringify( request.columns ) !== JSON.stringify( cacheLastRequest.columns ) ||
|
JSON.stringify(request.search) !== JSON.stringify(cacheLastRequest.search)
|
||||||
JSON.stringify( request.search ) !== JSON.stringify( cacheLastRequest.search )
|
|
||||||
) {
|
) {
|
||||||
// properties changed (ordering, columns, searching)
|
// properties changed (ordering, columns, searching)
|
||||||
ajax = true;
|
ajax = true;
|
||||||
}
|
} else if (cacheLastJson == undefined || cacheLastJson.length == 0) {
|
||||||
else if(cacheLastJson == undefined || cacheLastJson.length==0)
|
|
||||||
{
|
|
||||||
ajax = true;
|
ajax = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,13 +101,13 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
|||||||
"success": function ( json ) {
|
"success": function ( json ) {
|
||||||
cacheLastJson = $.extend(true, {}, json);
|
cacheLastJson = $.extend(true, {}, json);
|
||||||
|
|
||||||
if ( cacheLower != drawStart ) {
|
if (cacheLower != drawStart && requestLength != -1) {
|
||||||
json.data.splice( 0, drawStart-cacheLower );
|
json.data.splice(0, drawStart-cacheLower);
|
||||||
}
|
}
|
||||||
if ( requestLength >= -1 ) {
|
if (requestLength >= -1) {
|
||||||
json.data.splice( requestLength, json.data.length );
|
json.data.splice(requestLength, json.data.length);
|
||||||
}
|
}
|
||||||
drawCallback( json );
|
drawCallback(json);
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
|||||||
'attribute_code' => $sAttCode,
|
'attribute_code' => $sAttCode,
|
||||||
'attribute_type' => '_key_',
|
'attribute_type' => '_key_',
|
||||||
'attribute_label' => $aData['alias'],
|
'attribute_label' => $aData['alias'],
|
||||||
"render" => "return '<a class=\'object-ref-link\' href= \'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a>' ;",
|
"render" => "let displayField = '<span class=\"object-ref\" title=\"".$sClassAlias."::'+data+'\"><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a></span>'; if (row['".$sClassAlias."/obsolescence_flag'].indexOf('no') == -1){displayField = '<span class=\"object-ref obsolete\" title=\"obsolete\"><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'><span class=\"object-ref-icon fas fa-eye-slash object-obsolete fa-1x fa-fw\"></span>'+row['".$sClassAlias."/friendlyname']+'</a></span>';} return displayField;",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -542,7 +542,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
|||||||
'attribute_code' => $sAttCode,
|
'attribute_code' => $sAttCode,
|
||||||
'attribute_type' => '_key_',
|
'attribute_type' => '_key_',
|
||||||
'attribute_label' => $aData['alias'],
|
'attribute_label' => $aData['alias'],
|
||||||
"render" => "return '<a class=\'object-ref-link\' href= \'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a>' ;",
|
"render" => "let displayField = '<span class=\"object-ref\" title=\"".$sClassAlias."::'+data+'\"><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a></span>'; if (row['".$sClassAlias."/obsolescence_flag'].indexOf('no') == -1){displayField = '<span class=\"object-ref obsolete\" title=\"obsolete\"><span class=\"object-ref-icon fas fa-eye-slash object-obsolete fa-1x fa-fw\"></span><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a></span>';} return displayField;",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -669,7 +669,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
|||||||
];
|
];
|
||||||
$aColumnDefinition["data"] = $sClassAlias."/".$sAttCode;
|
$aColumnDefinition["data"] = $sClassAlias."/".$sAttCode;
|
||||||
$aColumnDefinition["render"] = [
|
$aColumnDefinition["render"] = [
|
||||||
"display" => "return '<a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a>' ;",
|
"display" => "let displayField = '<span class=\"object-ref\" title=\"".$sClassAlias."::'+data+'\"><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a></span>'; if (row['".$sClassAlias."/obsolescence_flag'].indexOf('no') == -1){displayField = '<span class=\"object-ref obsolete\" title=\"obsolete\"><span class=\"object-ref-icon fas fa-eye-slash object-obsolete fa-1x fa-fw\"></span><a class=\'object-ref-link\' href=\'UI.php?operation=details&class=".$sClassName."&id='+data+'\'>'+row['".$sClassAlias."/friendlyname']+'</a></span>';} return displayField;",
|
||||||
"_" => $sClassAlias."/".$sAttCode,
|
"_" => $sClassAlias."/".$sAttCode,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,17 +22,21 @@ var maxHeight{{ sListId }} = 300;
|
|||||||
if ($('#{{ oUIBlock.GetId() }}').closest('.ui-dialog').length > 0)
|
if ($('#{{ oUIBlock.GetId() }}').closest('.ui-dialog').length > 0)
|
||||||
{
|
{
|
||||||
//we are in dialogbox
|
//we are in dialogbox
|
||||||
maxHeight{{ sListId }} = $('#{{ oUIBlock.GetId() }}').closest('.ui-dialog').height();
|
maxHeight{{ sListId }} = $('#{{ oUIBlock.GetId() }}').closest('.ui-dialog-content').height();
|
||||||
a
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maxHeight{{ sListId }} = $(window).height()-$('#ibo-top-container').outerHeight()+$('#ibo-main-content').height()-$('#ibo-main-content').outerHeight();
|
maxHeight{{ sListId }} = $(window).height()-$('#ibo-top-container').outerHeight()+$('#ibo-main-content').height()-$('#ibo-main-content').outerHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('#{{ oUIBlock.GetId() }}').closest('[data-target=search_results]').parent().find('.ibo-search-form-panel').length > 0)
|
if ($('#{{ oUIBlock.GetId() }}').closest('[data-target=search_results]').parent().find('.ibo-search-form-panel').length > 0)
|
||||||
{
|
{
|
||||||
//we are in dialogbox
|
//we are in dialogbox
|
||||||
maxHeight{{ sListId }} = maxHeight{{ sListId }}-$('#{{ oUIBlock.GetId() }}').closest('[data-target=search_results]').parent().find('.ibo-search-form-panel').height();
|
maxHeight{{ sListId }} = maxHeight{{ sListId }}-$('#{{ oUIBlock.GetId() }}').closest('[data-target=search_results]').parent().find('.ibo-search-form-panel').outerHeight();
|
||||||
|
}
|
||||||
|
if ($('#{{ oUIBlock.GetId() }}').closest('.ibo-panel--header').length > 0)
|
||||||
|
{
|
||||||
|
maxHeight{{ sListId }} = maxHeight{{ sListId }}-$('#{{ oUIBlock.GetId() }}').closest('.ibo-panel--header').outerHeight();
|
||||||
}
|
}
|
||||||
if (maxHeight{{ sListId }} < 300)
|
if (maxHeight{{ sListId }} < 300)
|
||||||
{
|
{
|
||||||
@@ -42,7 +46,7 @@ else
|
|||||||
{
|
{
|
||||||
maxHeight{{ sListId }} = maxHeight{{ sListId }} -50;
|
maxHeight{{ sListId }} = maxHeight{{ sListId }} -50;
|
||||||
}
|
}
|
||||||
|
console.warn(maxHeight{{ sListId }});
|
||||||
var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||||
language: {
|
language: {
|
||||||
processing: "{{ 'UI:Datatables:Language:Processing'|dict_s }}",
|
processing: "{{ 'UI:Datatables:Language:Processing'|dict_s }}",
|
||||||
@@ -182,93 +186,109 @@ var oTable{{ sListId }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#{{ oUIBlock.GetId() }}').closest(".dataTables_scrollBody").css('max-height', maxHeight{{ sListId }}-100);
|
||||||
|
|
||||||
{% if oUIBlock.GetOption("select_mode") is not empty %}
|
{% if oUIBlock.GetOption("select_mode") is not empty %}
|
||||||
{% if oUIBlock.GetOption("select_mode") != "single" %}
|
{% if oUIBlock.GetOption("select_mode") != "single" %}
|
||||||
oTable{{ sListId }}.off('select').on('select', function (oEvent, dt, type, indexes) {
|
oTable{{ sListId }}.off('select').on('select', function (oEvent, dt, type, indexes) {
|
||||||
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
||||||
if( $(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative")
|
if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative")
|
||||||
{
|
{
|
||||||
// Checking input
|
// Checking input
|
||||||
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
||||||
// Saving values in temp array
|
// Saving values in temp array
|
||||||
for (let i in aData) {
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
// Checking input
|
// Checking input
|
||||||
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
||||||
// Saving values in temp array
|
// Saving values in temp array
|
||||||
for (let i in aData) {
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.push(iItemId);
|
oSelectedItems{{ sListId }}.push(iItemId);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
oTable{{ sListId }}.off('deselect').on('deselect', function (oEvent, dt, type, indexes) {
|
oTable{{ sListId }}.off('deselect').on('deselect', function (oEvent, dt, type, indexes) {
|
||||||
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
||||||
|
|
||||||
// Checking input
|
// Checking input
|
||||||
$('#{{ oUIBlock.GetId() }} tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
|
$('#{{ oUIBlock.GetId() }} tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
|
||||||
// Saving values in temp array
|
// Saving values in temp array
|
||||||
if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative") {
|
if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative")
|
||||||
for (let i in aData) {
|
{
|
||||||
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.push(iItemId);
|
oSelectedItems{{ sListId }}.push(iItemId);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
for (let i in aData) {
|
else
|
||||||
|
{
|
||||||
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
{% else %}
|
{% else %}
|
||||||
oTable{{ sListId }}.off('select').on('select', function (oEvent, dt, type, indexes) {
|
oTable{{ sListId }}.off('select').on('select', function (oEvent, dt, type, indexes) {
|
||||||
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
||||||
// Checking input
|
// Checking input
|
||||||
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
$('#{{ oUIBlock.GetId() }} tr[role="row"].selected td:first-child input').prop('checked', true);
|
||||||
// Saving values in temp array
|
// Saving values in temp array
|
||||||
for (let i in aData) {
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) === -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.push(iItemId);
|
oSelectedItems{{ sListId }}.push(iItemId);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
oTable{{ sListId }}.off('deselect').on('deselect', function (oEvent, dt, type, indexes) {
|
oTable{{ sListId }}.off('deselect').on('deselect', function (oEvent, dt, type, indexes) {
|
||||||
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
let aData = oTable{{ sListId }}.rows(indexes).data().toArray();
|
||||||
|
|
||||||
// Checking input
|
// Checking input
|
||||||
$('#{{ oUIBlock.GetId() }} tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
|
$('#{{ oUIBlock.GetId() }} tr[role="row"]:not(.selected) td:first-child input').prop('checked', false);
|
||||||
// Saving values in temp array
|
// Saving values in temp array
|
||||||
for (let i in aData) {
|
for (let i in aData)
|
||||||
|
{
|
||||||
let iItemId = aData[i].id;
|
let iItemId = aData[i].id;
|
||||||
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1) {
|
if (oSelectedItems{{ sListId }}.indexOf(iItemId) > -1)
|
||||||
|
{
|
||||||
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
oSelectedItems{{ sListId }}.splice(oSelectedItems{{ sListId }}.indexOf(iItemId), 1);
|
||||||
updateDataTableSelection('{{ sListId }}');
|
updateDataTableSelection('{{ sListId }}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if oUIBlock.GetOption('sCountSelector') is not empty %}
|
{% if oUIBlock.GetOption('sCountSelector') is not empty %}
|
||||||
$('#{{ sListId }} [name="selectionCount"]').bind('change', function() {
|
$('#{{ sListId }} [name="selectionCount"]').bind('change', function() {
|
||||||
|
|||||||
@@ -25,6 +25,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% if oUIBlock.GetComments() %}
|
{% if oUIBlock.GetComments() %}
|
||||||
<div class="ibo-field--comments">{{ oUIBlock.GetComments() }}</div>
|
<div class="ibo-field--comments">{{ oUIBlock.GetComments()|raw }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user