From a48b8290b324b4cba87332f00de3092f80b5be04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Fri, 6 Sep 2019 18:37:03 +0200 Subject: [PATCH] Allow reordering of the parts table columns. --- assets/js/app.js | 1 + assets/ts_src/ajax_ui.ts | 1 + package.json | 1 + yarn.lock | 17 +++++++++++++++++ 4 files changed, 20 insertions(+) diff --git a/assets/js/app.js b/assets/js/app.js index c66b8399..9abcd7a6 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -38,6 +38,7 @@ require( 'datatables.net-buttons/js/buttons.print.js' ); //require( 'datatables.net-colreorder-bs4' )(); require( 'datatables.net-fixedheader-bs4' ); require( 'datatables.net-select-bs4' ); +require('datatables.net-colreorder-bs4'); require('bootstrap-select'); require('jquery-form'); diff --git a/assets/ts_src/ajax_ui.ts b/assets/ts_src/ajax_ui.ts index d1eabc18..30acc07e 100644 --- a/assets/ts_src/ajax_ui.ts +++ b/assets/ts_src/ajax_ui.ts @@ -510,6 +510,7 @@ class AjaxUI { //@ts-ignore var promise = $('#part_list').initDataTables(settings, { + colReorder: true, "fixedHeader": { header: $(window).width() >= 768, //Only enable fixedHeaders on devices with big screen. Fixes scrolling issues on smartphones. headerOffset: $("#navbar").height()}, "buttons": [ { diff --git a/package.json b/package.json index 00a7cc1e..8aff5212 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "bootstrap-select": "^1.13.8", "datatables.net-bs4": "^1.10.19", "datatables.net-buttons-bs4": "^1.5.4", + "datatables.net-colreorder-bs4": "^1.5.1", "datatables.net-fixedheader-bs4": "^3.1.5", "datatables.net-select-bs4": "^1.2.7", "jquery-form": "^4.2.2", diff --git a/yarn.lock b/yarn.lock index d7604550..2c2deeb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2259,6 +2259,23 @@ datatables.net-buttons@1.5.6: datatables.net "^1.10.15" jquery ">=1.7" +datatables.net-colreorder-bs4@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/datatables.net-colreorder-bs4/-/datatables.net-colreorder-bs4-1.5.1.tgz#7ded353a68296b85f0dbfb234b8cb5d8fc2bee3c" + integrity sha512-mi5wxkjnkI8fxGJ9e/Vu20E7MMZj7yK3xjLIzDrsHOHQupr6FF6eJnUoVH4gDo9Ynfb/yApVbnuW29v/YjnDKw== + dependencies: + datatables.net-bs4 "^1.10.15" + datatables.net-colreorder "1.5.1" + jquery ">=1.7" + +datatables.net-colreorder@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/datatables.net-colreorder/-/datatables.net-colreorder-1.5.1.tgz#ee5eacd7178b5fd9396aab44d4907aae35086f8c" + integrity sha512-nKV0ZBOdOG+CCrtDZZlTOvhu9NC53pr4rYR8Xhd3KIKipLZohWWdBoOFGMu+VKDvllg2Xj79oS/wicYSiNyteA== + dependencies: + datatables.net "^1.10.15" + jquery ">=1.7" + datatables.net-fixedheader-bs4@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/datatables.net-fixedheader-bs4/-/datatables.net-fixedheader-bs4-3.1.5.tgz#60e060b721f46690a85e1acde634e75cc14e3cba"