[pve-devel] [PATCH pve-manager 1/3] ext6migrate: use Array.prototype.concat() instead of push()

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Feb 3 13:22:42 CET 2016


What about just removing the brackets to pass the elements as multiple
parameters to push()?
iow.
  a.push(1, 2, 3);
instead of
  a.push([1, 2, 3]);

On Wed, Feb 03, 2016 at 12:11:45PM +0100, Emmanuel Kasper wrote:
> Using push here would add an array of elements instead of the elements.
> Seems ExtJS6 can't cope with that.
> 
> This fix is needed for buttons and columns to be properly displayed when
> loading the component.
> ---
>  www/manager6/grid/FirewallRules.js | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
> index c23fc76..37fc262 100644
> --- a/www/manager6/grid/FirewallRules.js
> +++ b/www/manager6/grid/FirewallRules.js
> @@ -121,7 +121,7 @@ Ext.define('PVE.FirewallRulePanel', {
>  	    });
>  	}
>  
> -	me.column1.push([
> +	me.column1 = me.column1.concat([
>  	    {
>  		xtype: 'displayfield',
>  		fieldLabel: '',
> @@ -587,7 +587,7 @@ Ext.define('PVE.FirewallRules', {
>  	if (me.groupBtn) {
>  	    tbar.push(me.groupBtn);
>  	}
> -	tbar.push([ me.removeBtn, me.editBtn ]);
> +	tbar = tbar.concat([ me.removeBtn, me.editBtn ]);
>  
>  	var render_errors = function(name, value, metaData, record) {
>  	    var errors = record.data.errors;
> @@ -675,7 +675,7 @@ Ext.define('PVE.FirewallRules', {
>  	    });
>  	}
>  
> -	columns.push([
> +	columns = columns.concat([
>  	    {
>  		header: gettext('Source'),
>  		dataIndex: 'source',
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list