I am trying to use the »repeatable« form field. Right now I have this in code in the templateDetails.xml
<config>
<fields name="params">
<fieldset name="advanced">
<field
type="repeatable"
label="label"
name="stuff_list"
default='{"stuffCSS":[], "stuffFile": []}'>
<fields name="params">
<fieldset hidden="true" name="stuff_list_modal" repeat="true">
<field type="filelist"
label="stuffFile"
name="stuffFile"
hide_default="true"
hide_none="true"
directory="templates/tmpl/img" />
<field type="text"
label="stuffCSS"
name="stuffCSS"
default="" />
</fieldset>
</fields>
</field>
</fieldset>
</fields>
</config>
That works if I set the values for one row. But If I enter values for a second, each click of the »select« button redirects out of the edit screen, to the overview page of the template styles…
Any Help would be great!
EDIT
I just had a look in the database where the JSON string is stored correctly. So I replaced the compressed js version of /media/system/js/repeatable.js
with the uncompressed version and stepped through with firebug. Result:
The javascript error is thrown in line 185:
$('select').chosen({
disable_search_threshold : 10,
allow_single_deselect : true
});
TypeError: $(...).chosen is not a function
http://xxx/media/system/js/repeatable.js
Line 185
EDIT #2
I just commented out the lines show above (185 - 188) and it works!