[pve-devel] [PATCH manager 2/2] disable selecting when right clicking in tree

Dietmar Maurer dietmar at proxmox.com
Fri Apr 29 07:41:36 CEST 2016


>  	Ext.apply(me, {
> +	    allowSelection: true,
>  	    store: store,
>  	    viewConfig: {
>  		// note: animate cause problems with applyState
> @@ -398,7 +399,16 @@ Ext.define('PVE.tree.ResourceTree', {
>  		},
>  		destroy: function() {
>  		    rstore.un("load", updateTree);
> -		}
> +		},
> +		beforecellmousedown: function (tree, record,item,index,ev) {
> +		    // disable selection when right clicking
> +		    me.allowSelection = !(event.button === 2);
> +		},
> +		beforeselect: function (tree, record, index, eopts) {
> +		    var allow = !!me.allowSelection;

me.allowSelection looks like a boolean to me, So why do you use '!!' here?



More information about the pve-devel mailing list