[FIX] website_forum: use other attr than value to init select2
The backend would otherwise fail because the value has been already processed
This commit is contained in:
parent
ad1ca233ca
commit
5d58b5551f
|
@ -171,7 +171,7 @@
|
|||
// Take default tags from the input value
|
||||
initSelection: function (element, callback) {
|
||||
var data = [];
|
||||
_.each(JSON.parse(element.val()), function(x) {
|
||||
_.each(element.data('init-value'), function(x) {
|
||||
data.push({ id: x.id, text: x.name, isNew: false });
|
||||
});
|
||||
element.val('');
|
||||
|
@ -179,7 +179,6 @@
|
|||
},
|
||||
});
|
||||
|
||||
//TODO Remove in master
|
||||
if($('input.load_tags').length){
|
||||
var tags = $("input.load_tags").val();
|
||||
$("input.load_tags").val("");
|
||||
|
|
|
@ -376,7 +376,7 @@
|
|||
<div t-if="not is_answer">
|
||||
<br/>
|
||||
<input type="hidden" name="tag_type" value="select2"/>
|
||||
<input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-value="#{tags}"/>
|
||||
<input type="hidden" name="question_tag" class="form-control col-md-9 js_select2" placeholder="Tags" value="see data init value" t-attf-data-init-value="#{tags}"/>
|
||||
<br/>
|
||||
</div>
|
||||
<button class="btn btn-primary btn-lg">Save</button>
|
||||
|
|
Loading…
Reference in New Issue