deform: fixed selecting of default values for select2 widget.
This commit is contained in:
parent
b7382fcefb
commit
21513d9b08
1 changed files with 3 additions and 3 deletions
|
|
@ -21,7 +21,7 @@
|
|||
tal:attributes="label item.label">
|
||||
<option tal:repeat="(value, description) item.options"
|
||||
tal:attributes="
|
||||
selected (multiple and value in list(map(unicode, cstruct)) or value == list(map(unicode, cstruct))) and 'selected';
|
||||
selected python:field.widget.get_select_value(cstruct, value);
|
||||
class css_class;
|
||||
label field.widget.long_label_generator and description;
|
||||
value value"
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</optgroup>
|
||||
<option tal:condition="not isinstance(item, optgroup_class)"
|
||||
tal:attributes="
|
||||
selected (multiple and item[0] in list(map(unicode, cstruct)) or item[0] == unicode(cstruct)) and 'selected';
|
||||
selected python:field.widget.get_select_value(cstruct, item[0]);
|
||||
class css_class;
|
||||
value item[0]">${item[1]}</option>
|
||||
</tal:loop>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
deform.addCallback(
|
||||
'${field.oid}',
|
||||
'${oid}',
|
||||
function(oid) {
|
||||
$('#' + oid).select2({
|
||||
containerCssClass: 'form-control drop-menu',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue