mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4529 - Object list: Count in header not updated when refreshing through the icon
This commit is contained in:
@@ -157,11 +157,11 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
||||
}
|
||||
if ($oDataTable->GetOption("select_mode") == 'multiple')
|
||||
{
|
||||
$sSubTitle =Dict::Format('UI:Pagination:HeaderSelection', $iCount, '<span class="ibo-datatable--selected-count">0</span>');
|
||||
$sSubTitle =Dict::Format('UI:Pagination:HeaderSelection', '<span class="ibo-datatable--result-count">'.$iCount.'</span>', '<span class="ibo-datatable--selected-count">0</span>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$sSubTitle = Dict::Format('UI:Pagination:HeaderNoSelection', $iCount);
|
||||
$sSubTitle = Dict::Format('UI:Pagination:HeaderNoSelection', '<span class="ibo-datatable--result-count">'.$iCount.'</span>');
|
||||
}
|
||||
$oContainer->AddSubTitleBlock(new Html($sSubTitle));
|
||||
if(isset($aExtraParams["panel_icon"]) && strlen($aExtraParams["panel_icon"]) > 0){
|
||||
|
||||
@@ -82,7 +82,8 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
}
|
||||
}
|
||||
},
|
||||
drawCallback: function () {
|
||||
drawCallback: function (settings) {
|
||||
$(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal);
|
||||
if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative")
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.checkAll')[0].checked = true;
|
||||
@@ -106,7 +107,8 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
});
|
||||
},
|
||||
{% else %}
|
||||
drawCallback: function () {
|
||||
drawCallback: function (settings) {
|
||||
$(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal);
|
||||
$(this).closest('.dataTables_wrapper').unblock();
|
||||
// Hiding pagination if only one page
|
||||
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
|
||||
@@ -23,7 +23,8 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{orderable: false, targets: 0}
|
||||
],
|
||||
{% endif %}
|
||||
drawCallback: function () {
|
||||
drawCallback: function (settings) {
|
||||
$(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal);
|
||||
// Hiding pagination if only one page
|
||||
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,8 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
},
|
||||
{% endfor %}
|
||||
],
|
||||
drawCallback: function () {
|
||||
drawCallback: function (settings) {
|
||||
$(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal);
|
||||
// Hiding pagination if only one page
|
||||
if ($(this).closest('.dataTables_wrapper').find('.dataTables_paginate:last .paginate_button:not(.previous):not(.next)').length < 2)
|
||||
{
|
||||
@@ -65,6 +66,10 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.dataTables_paginate, .dataTables_info').show();
|
||||
}
|
||||
if ($(this).closest('.ibo-panel--body').find('[name=selectionMode]').val() === "negative")
|
||||
{
|
||||
$(this).closest('.dataTables_wrapper').find('.checkAll')[0].checked = true;
|
||||
}
|
||||
},
|
||||
initComplete: function () {
|
||||
if (this.api().page.info().pages < 2)
|
||||
|
||||
Reference in New Issue
Block a user