master #116

Merged
mpeltriaux merged 13 commits from master into 110_Biotope_codelists 2022-02-16 08:50:41 +01:00
2 changed files with 6 additions and 22 deletions
Showing only changes of commit d04d02380f - Show all commits

View File

@ -22,7 +22,7 @@ from intervention.inputs import TreeSelectMultiple
from konova.contexts import BaseContext from konova.contexts import BaseContext
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
from konova.models import DeadlineType from konova.models import DeadlineType
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \ from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, \
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED

View File

@ -1,18 +1,14 @@
<div id="jstree"> <div id="jstree"></div>
</div> <input id="jstree-input" name="{{ widget.name }}" hidden="hidden"/>
<input id="jstree-input" name="{{ widget.name }}[]" hidden="hidden"/>
<script> <script>
$(function () { $(function () {
$('#jstree').jstree({ $('#jstree').jstree({
'plugins': [ 'plugins': [
'checkbox', 'checkbox',
'wholerow',
], ],
'checkbox': {
'whole_node': false,
},
'core' : { 'core' : {
'data' : { 'data' : {
'url' : '{{ widget.attrs.url }}', 'url' : '{{ widget.attrs.url }}',
@ -24,22 +20,10 @@
}); });
$('#jstree') $('#jstree')
.on('deselect_node.jstree', function (e, data) { .on('deselect_node.jstree', function (e, data) {
$(data.selected).each(function (val){ $('#jstree-input').val(data.selected);
console.log(val)
console.log(this)
$(this).after(
"<input name='{{widget.name}}[]' value="+val+"/>"
)
});
//$('#jstree-input').val(data.selected);
}) })
.on('select_node.jstree', function (e, data) { .on('select_node.jstree', function (e, data) {
$(data.selected).each(function (val){ $('#jstree-input').val(data.selected);
$(this).after(
"<input name='{{widget.name}}[]' value="+val+"/>"
)
});
//$('#jstree-input').val(data.selected);
}) })
}); });
</script> </script>