Skip to content

Commit 6a3cfdc

Browse files
committed
Pass form in options - allows for persistence of tree data
1 parent a2c9b19 commit 6a3cfdc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%label.mdl-checkbox.mdl-js-checkbox.mdl-js-ripple-effect{ for: @options[:node]["id"] }
2-
= context[:form].check_box "data[values][#{@options[:node]['id']}]", { checked: value, class: 'mdl-checkbox__input', id: @options[:node]["id"] }, 1, nil
3-
= context[:form].label :data, display_lineage, class: 'mdl-checkbox__label'
2+
= @options[:form].check_box "data[values][#{@options[:node]['id']}]", { checked: value, class: 'mdl-checkbox__input', id: @options[:node]["id"] }, 1, nil
3+
= @options[:form].label :data, display_lineage, class: 'mdl-checkbox__label'
44

55
- if @options[:node]["children"].any?
66
- @options[:node]["children"].each do |child|
7-
= cell(Plugins::Core::CheckboxCell, nil, node: child, child: child_identifier, data: @options[:data]).(:checkbox)
7+
= cell(Plugins::Core::CheckboxCell, nil, form: @options[:form], node: child, child: child_identifier, data: @options[:data]).(:checkbox)

app/cells/plugins/core/tree/checkboxes.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
- @options[:metadata]["data"]["tree_array"].each do |node|
55
= render_field_id
6-
= cell(Plugins::Core::CheckboxCell, nil, node: node, data: data).(:checkbox)
6+
= cell(Plugins::Core::CheckboxCell, nil, form: @options[:form], node: node, data: data).(:checkbox)

0 commit comments

Comments
 (0)