WIP: #112 Restructure CompensationAction
This commit is contained in:
		
							parent
							
								
									23790bca8d
								
							
						
					
					
						commit
						3df605376c
					
				@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user