]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
improve multiselect behaviour for checkboxmodel
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 22 Apr 2020 07:26:23 +0000 (09:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 23 Oct 2020 11:24:45 +0000 (13:24 +0200)
when using the mode 'MULTI' for the checkbox selection model,
clicking a row would deselect all others, only clicking exactly on the
checkbox would select multiple rows

this override makes the whole cell of the checkbox behave like the
checkbox. This minimizes misclicks from the user.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/Toolkit.js

index f7060366b53ef1644c8c216431d3ee9daadccca9..8a27b26cc738c56f2bae9095f9cd070b291f6bc2 100644 (file)
@@ -493,6 +493,13 @@ Ext.define('Proxmox.validIdReOverride', {
     validIdRe: /^[a-z_][a-z0-9\-_@]*$/i,
 });
 
+// use whole checkbox cell to multiselect, not only the checkbox
+Ext.define('Proxmox.selection.CheckboxModel', {
+    override: 'Ext.selection.CheckboxModel',
+
+    checkSelector: '.x-grid-cell-row-checker',
+});
+
 // force alert boxes to be rendered with an Error Icon
 // since Ext.Msg is an object and not a prototype, we need to override it
 // after the framework has been initiated