mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
N°1386 - Advanced Search: Navigation in list - Browse this list - new version
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
{% if oUIBlock.GetOption("select_mode") is not empty %}
|
||||
var oSelectedItems{{ oUIBlock.GetOption('sListId')|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = [];
|
||||
{% if oUIBlock.GetOption("sSelectedRows") is not empty %}
|
||||
oSelectedItems{{ oUIBlock.GetOption('sListId')|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = {{ oUIBlock.GetOption('sSelectedRows')|raw }};
|
||||
{% endif %}
|
||||
var oSelectedItems{{ oUIBlock.GetOption('sListId')|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = [];
|
||||
{% if oUIBlock.GetOption("sSelectedRows") is not empty %}
|
||||
oSelectedItems{{ oUIBlock.GetOption('sListId')|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = {{ oUIBlock.GetOption('sSelectedRows')|raw }};
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
var bSelectAllowed{{ oUIBlock.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = false;
|
||||
|
||||
$('body').append($('<form/>')
|
||||
.attr({'method': 'post', 'id': 'basket{{ oUIBlock.GetId() }}'})
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'filter', 'value': "{{ oUIBlock.GetFilter()|raw }}"})
|
||||
)
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'back_url', 'value': window.location.href})
|
||||
)
|
||||
);
|
||||
@@ -108,14 +108,25 @@ var oTable{{ sListIDForVarSuffix }} = $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
// Disable hyperlinks if necessary
|
||||
{% if oUIBlock.GetOption("disable_hyperlinks") is not same as false %}
|
||||
$("#{{ oUIBlock.GetId() }} a").on('click', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
{% else %}
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}_wrapper').find('.object-in-basket').on('click',
|
||||
function () {
|
||||
console.warn('ici');
|
||||
sUrl = $(this).attr('data-href');
|
||||
$('#basket{{ oUIBlock.GetId() }}').attr('action', sUrl);
|
||||
$('#basket{{ oUIBlock.GetId() }}').submit();
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
{% endif %}
|
||||
|
||||
},
|
||||
{% else %}
|
||||
drawCallback: function (settings) {
|
||||
if(settings.json)
|
||||
if (settings.json)
|
||||
{
|
||||
$(this).closest('.ibo-panel').find('.ibo-datatable--result-count').html(settings.json.recordsTotal);
|
||||
}
|
||||
@@ -129,12 +140,25 @@ 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();
|
||||
});
|
||||
{% else %}
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}_wrapper').find('.object-in-basket').on('click',
|
||||
function () {
|
||||
console.warn('ici');
|
||||
sUrl = $(this).attr('data-href');
|
||||
$('#basket{{ oUIBlock.GetId() }}').attr('action', sUrl);
|
||||
$('#basket{{ oUIBlock.GetId() }}').submit();
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
{% endif %}
|
||||
},
|
||||
{% endif %}
|
||||
@@ -435,17 +459,19 @@ if ($('#datatable_dlg_{{ oUIBlock.GetId() }}').hasClass('itop-datatable'))
|
||||
}
|
||||
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings(aOptions{{ sListIDForVarSuffix }});
|
||||
|
||||
if(window.ResizeObserver){
|
||||
let oTable{{ sListIDForVarSuffix }}ResizeTimeout = null;
|
||||
const oTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function(){
|
||||
clearTimeout(oTable{{ sListIDForVarSuffix }}ResizeTimeout);
|
||||
oTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function(){
|
||||
$('#{{ oUIBlock.GetId() }}').DataTable().columns.adjust();
|
||||
}, 120);
|
||||
});
|
||||
oTable{{ sListIDForVarSuffix }}Resize.observe($('#{{ oUIBlock.GetId() }}')[0]);
|
||||
if (window.ResizeObserver)
|
||||
{
|
||||
let oTable{{ sListIDForVarSuffix }}ResizeTimeout = null;
|
||||
const oTable{{ sListIDForVarSuffix }}Resize = new ResizeObserver(function () {
|
||||
clearTimeout(oTable{{ sListIDForVarSuffix }}ResizeTimeout);
|
||||
oTable{{ sListIDForVarSuffix }}ResizeTimeout = setTimeout(function () {
|
||||
$('#{{ oUIBlock.GetId() }}').DataTable().columns.adjust();
|
||||
}, 120);
|
||||
});
|
||||
oTable{{ sListIDForVarSuffix }}Resize.observe($('#{{ oUIBlock.GetId() }}')[0]);
|
||||
}
|
||||
|
||||
{% if oUIBlock.HasRowActions() %}
|
||||
{% include 'base/components/datatable/row-actions/handler.js.twig' %}
|
||||
{% endif %}
|
||||
{% include 'base/components/datatable/row-actions/handler.js.twig' %}
|
||||
{% endif %}
|
||||
console.warn('ici-lala');
|
||||
@@ -5,10 +5,12 @@
|
||||
{% block iboNavigation %}
|
||||
<form id="ibo-form-navigation" class="ibo-navigation-form" method="post">
|
||||
<input type="hidden" name="listNavigation" value="{{ oUIBlock.GetList() }}"/>
|
||||
<input type="hidden" name="filter" value="{{ oUIBlock.GetFilter() }}"/>
|
||||
<input type="hidden" name="back-url" value="{{ oUIBlock.GetBackUrl()|raw }}"/>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-up" id="{{ oUIBlock.GetId() }}-back"></div>
|
||||
{% if oUIBlock.HasPrec() %}
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-double-left" id="{{ oUIBlock.GetId() }}-first"></div>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-left" id="{{oUIBlock.GetId() }}-prev"></div>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-left" id="{{ oUIBlock.GetId() }}-prev"></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
console.warn('ICI');
|
||||
$('#{{ oUIBlock.GetId() }}-back').on('click', function() {
|
||||
window.location = '{{ oUIBlock.GetUrlSearch()|raw }}';
|
||||
$('#{{ oUIBlock.GetId() }}-back').on('click', function () {
|
||||
window.location = '{{ oUIBlock.GetBackUrl()|raw }}';
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-first').on('click', function() {
|
||||
$('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlFirst() | raw}} ');
|
||||
$('#{{ oUIBlock.GetId() }}-first').on('click', function () {
|
||||
$('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlFirst() | raw }} ');
|
||||
$('#ibo-form-navigation').submit();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-prev').on('click', function() {
|
||||
$('#{{ oUIBlock.GetId() }}-prev').on('click', function () {
|
||||
$('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetUrlPrev()| raw }} ');
|
||||
$('#ibo-form-navigation').submit();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user