N°3746 - Migrate modal to new UIBlock system - update fields when change class selection

This commit is contained in:
acognet
2021-03-23 11:08:11 +01:00
parent ab5e5a7f4a
commit dfbb362330
2 changed files with 280 additions and 307 deletions

View File

@@ -2,7 +2,7 @@
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% set sListId = oUIBlock.GetOption('sListId') %}
{% if oUIBlock.GetOption("iPageSize") is not empty %}
{% set iPageSize = oUIBlock.GetOption("iPageSize") %}
{% set iPageSize = oUIBlock.GetOption("iPageSize") %}
{% else %}
{% set iPageSize = 10 %}
{% endif %}
@@ -300,29 +300,30 @@ oTable{{ sListId }}.off('deselect').on('deselect', function (oEvent, dt, type, i
});
{% endif %}
{% if oUIBlock.GetOption('sCountSelector') is not empty %}
$('#{{ sListId }} [name="selectionCount"]').bind('change', function() {
$('{{ oUIBlock.GetOption('sCountSelector') }}').val($('#{{ sListId }} [name="selectionCount"]').val());
$('{{ oUIBlock.GetOption('sCountSelector') }}').trigger('change');
});
{% endif %}
{% if oUIBlock.GetOption('sCountSelector') is not empty %}
$('#{{ sListId }} [name="selectionCount"]').bind('change', function () {
$('{{ oUIBlock.GetOption('sCountSelector') }}').val($('#{{ sListId }} [name="selectionCount"]').val());
$('{{ oUIBlock.GetOption('sCountSelector') }}').trigger('change');
});
{% endif %}
{% endif %}
$('#datatable_dlg_{{ oUIBlock.GetId() }}').dialog(
{
autoOpen: false,
title: "{{ 'UI:ListConfigurationTitle'|dict_s }}",
width: 500,
open: function(){
$('#datatable_dlg_{{ oUIBlock.GetId() }}').find('[name=action]').val("none");
},
close: function (event, ui) { //save data and refresh
if( $('#datatable_dlg_{{ oUIBlock.GetId() }}').find('[name=action]').val() === "none") {
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings('onDlgCancel');
{
autoOpen: false,
title: "{{ 'UI:ListConfigurationTitle'|dict_s }}",
width: 500,
open: function () {
$('#datatable_dlg_{{ oUIBlock.GetId() }}').find('[name=action]').val("none");
},
close: function (event, ui) { //save data and refresh
if ($('#datatable_dlg_{{ oUIBlock.GetId() }}').find('[name=action]').val() === "none")
{
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings('onDlgCancel');
}
}
}
});
});
$aOptions = {
sListId: '{{ oUIBlock.GetId() }}',
@@ -338,4 +339,9 @@ $aOptions = {
oLabels: {moveup: "{{ 'UI:Button:MoveUp'|dict_s }}", movedown: "{{ 'UI:Button:MoveDown'|dict_s }}"},
};
if ($('#datatable_dlg_{{ oUIBlock.GetId() }}').hasClass('itop-datatable'))
{
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings('destroy');
}
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings($aOptions);