From a182d664f730e1346a262f1278fa7d7c987f408c Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Tue, 27 Oct 2020 14:58:41 -0300 Subject: [PATCH] Bug 8179: Set render functions in every column Because when AcqReceiveMultipleOrderLines is set to allow, we add an extra column at the beginning, general columnDefs of datatables config pointed to the wrong column. So, instead of using general columnDef, this patch sets the render function to each column. --- .../prog/en/modules/acqui/parcel.tt | 82 ++++++++++++------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 6f4bf57fdb..1595d89ff3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -430,28 +430,6 @@ "items" ], 'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', - "columnDefs": [ { - "targets": [3,4,5,9], - "render": function (data, type, row, meta) { - if ( data != null ) { - return data.escapeHtml(); - } - else { - return ""; - } - } - }, - { - "targets": [8,10], - "render": function (data, type, row, meta) { - if ( data != null ) { - return data.escapeHtml().format_price(); - } - else { - return ""; - } - } - } ], "columns": [ { "data": "basket.name", "orderable": true, @@ -493,19 +471,43 @@ "data": "biblio.author", "visible": false, "searchable": true, - "orderable": false + "orderable": false, + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml(); + } + else { + return ""; + } + } }, { "data": "biblio.title", "visible": false, "searchable": true, - "orderable": false + "orderable": false, + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml(); + } + else { + return ""; + } + } }, { "data": "biblio.isbn", "visible": false, "searchable": true, - "orderable": false + "orderable": false, + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml(); + } + else { + return ""; + } + } }, { "data": function(row, type, val, meta) { @@ -590,14 +592,38 @@ "orderable": false }, { - "data": "replacement_price" + "data": "replacement_price", + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml().format_price(); + } + else { + return ""; + } + } }, { "data": "quantity", - "orderable": true + "orderable": true, + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml(); + } + else { + return ""; + } + } }, { - "data": "ecost" + "data": "ecost", + "render": function (data, type, row, meta) { + if ( data != null ) { + return data.escapeHtml().format_price(); + } + else { + return ""; + } + } }, { "data": function ( row, type, val, meta ) { -- 2.25.0