mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
N°2737 - Migrate table to DataTables plugin in display objects
This commit is contained in:
@@ -11,10 +11,15 @@ var table{{ oUIBlock.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_
|
||||
dom: "t",
|
||||
"order": [],
|
||||
{% if oUIBlock.GetOption("select_mode") is not empty %}
|
||||
{% if oUIBlock.GetOption("select_mode") !="custom" %}
|
||||
select: {
|
||||
style: "{{ oUIBlock.GetOption("select_mode") }}"
|
||||
},
|
||||
{% endif %}
|
||||
columnDefs: [
|
||||
{orderable: false, targets: 0}
|
||||
],
|
||||
{% endif %}
|
||||
});
|
||||
if ($('#{{ oUIBlock.GetId() }}').find('thead').is(':visible'))
|
||||
{
|
||||
|
||||
@@ -35,18 +35,22 @@ $('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
rowId: "id",
|
||||
filter: false,
|
||||
{% if oUIBlock.GetOption("pageLength") is not empty %}
|
||||
pageLength: {{ oUIBlock.GetOptions()["pageLength"] }},
|
||||
pageLength: {{ oUIBlock.GetOption("pageLength") }},
|
||||
{% endif %}
|
||||
{% if oUIBlock.GetData()|length <= iPageSize %}
|
||||
paging: false,
|
||||
{% endif %}
|
||||
{% if oUIBlock.GetOption("dom") is not empty %}
|
||||
dom: "<'ibo-datatable-toolbar'{{ oUIBlock.GetOption("dom") }}>t",
|
||||
{% else %}
|
||||
dom: "<'ibo-datatable--toolbar'<'ibo-datatable--toolbar-left' pl><'ibo-datatable--toolbar-right' i>>t<'ibo-datatable--toolbar'<'ibo-datatable--toolbar-left' pl><'ibo-datatable--toolbar-right' i>>",
|
||||
{% endif %}
|
||||
lengthMenu: [[ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, -1], [ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, "{{ 'UI:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
columns: [
|
||||
{% for key, column in oUIBlock.GetColumns() %}
|
||||
{
|
||||
data: "{{ key }}",
|
||||
width: "auto",
|
||||
width: "auto",
|
||||
sortable: true
|
||||
},
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user