WIP: #112 Restructure CompensationAction

This commit is contained in:
mpeltriaux 2022-02-11 16:21:44 +01:00
parent 62e452c625
commit d04d02380f
2 changed files with 6 additions and 22 deletions

View File

@ -22,7 +22,7 @@ from intervention.inputs import TreeSelectMultiple
from konova.contexts import BaseContext
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
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

View File

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