menatwork/MultiColumnWizard — Issue #16: Problem mit numerischen Spaltennamen
Author: menatwork-dev
Created: 2012-01-04 15:02:48+00:00
State: open
Labels: Completed, Defect

Ich verwende in meinem MultiColumnWizard keine Namen für die Spalten.

```
'columnFields'	=> array
(
array
(
'label'	=> &$GLOBALS['TL_LANG']['xxx']['technical_data_0'],
'inputType'	=> 'text',
'eval'	=> array('style'=>'width:120px'),
),
array
(
'label'	=> &$GLOBALS['TL_LANG']['xxx']['technical_data_1'],
...
```

Lösung:

```
changeNamerecursive: function(arrEl, first, level)
{
arrEl.each(function(el){
if (el.name

![](= undefined && el.name )= null && el.name

![](= '' ){
var name = el.name.substring(0, el.name.indexOf('['));
el.name = el.name.replace(new RegExp(name+'\[[0-9]+\]', 'ig'), name+'[' + level + ']');
}
if (el.getProperty('for') )= undefined && el.getProperty('for')

![](= null && el.getProperty('for') )= '' ){
var name = el.getProperty('for').substring(0, el.getProperty('for').indexOf('['));
el.setProperty('for', el.getProperty('for').replace(new RegExp(name+'\[[0-9]+\]', 'ig'), name+'[' + level + ']'));
}
if (first.id

![](= undefined && first.id )= null && first.id != '' ){
var name = first.id.substring(0, first.id.indexOf('['));
el.id = first.id.replace(new RegExp(name+'\[[0-9]+\]', 'ig'), name+'[' + level + ']');
}

if (el.getChildren().length > 0)
MultiSelect.changeNamerecursive(el.getChildren(), first, level);

})
},
```

*--- Originally created by Andreas Schempp on 21.09.2011 10:39.*