From 2b01102025b51e7b4b4e750e43e006b07a738ac4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 22 Jan 2018 20:38:13 +0100 Subject: UI: manage multi select on table - improve basket management layout --- ishtar_common/templates/blocks/DataTables.html | 22 ++++++++++++++++------ .../templates/blocks/bs_form_snippet.html | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'ishtar_common/templates/blocks') diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 12f630de7..7f7e97c5b 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -2,7 +2,7 @@

- {% if url_new %} @@ -145,7 +145,21 @@ jQuery(document).ready(function(){ return json.rows; } }, - "select": {% if multiple_select %}true{% else %}'single'{% endif %}, + "select": { + "style": {% if multiple_select %}'multi'{% else %}'single'{% endif %} + }, + {% if multiple_select %}"buttons": [ + 'selectAll', + 'selectNone' + ], + language: { + buttons: { + selectAll: "{% trans 'Select all items' %}", + selectNone: "{% trans 'Select none' %}" + } + }, + "dom": 'lBtip', + {% endif %} "columns": [ { "data": "id", "visible": false }, { "data": "link", "orderable": false },{% for col in extra_cols %} @@ -236,8 +250,6 @@ jQuery(document).ready(function(){ }); {% else %} jQuery("#submit_form").click(function (){ - var mygrid = jQuery("#grid_{{name}}"); - var data = datatable_{{sname}}.rows( { selected: true } ).data(); {% if multiple_select %} var value = ""; @@ -256,7 +268,6 @@ jQuery(document).ready(function(){ }); function get_next_table_id(c_id){ - // var mygrid = jQuery("#grid_{{name}}"); var has_current_id = false; ids = datatable_{{sname}}.column(0).data(); @@ -267,7 +278,6 @@ jQuery(document).ready(function(){ return false; } function get_previous_table_id(c_id){ - // var mygrid = jQuery("#grid_{{name}}"); var previous_id = 0; ids = datatable_{{sname}}.column(0).data(); diff --git a/ishtar_common/templates/blocks/bs_form_snippet.html b/ishtar_common/templates/blocks/bs_form_snippet.html index ed0dc14e1..a4d772236 100644 --- a/ishtar_common/templates/blocks/bs_form_snippet.html +++ b/ishtar_common/templates/blocks/bs_form_snippet.html @@ -36,7 +36,7 @@

- -- cgit v1.2.3