diff --git a/CHANGELOG b/CHANGELOG index cf74e0016f..2ab980ed54 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Reset display_size of TreeView when group is cleared or changed * Allow relation field to be selected in CSV export * Hide empty cell on small screen * Support validate attribute of wizard's Button diff --git a/src/screen.js b/src/screen.js index 87f96ed47c..d291417103 100644 --- a/src/screen.js +++ b/src/screen.js @@ -1156,6 +1156,9 @@ } group.screens.push(this); this.tree_states_done = []; + this.views.map(function(view) { + view.reset(); + }); this.order = null; this.group = group; this.model = group.model; @@ -1329,6 +1332,9 @@ clear: function() { this.current_record = null; this.group.clear(); + this.views.map(function(view) { + view.reset(); + }); }, default_row_activate: function() { if ((this.current_view.view_type == 'tree') && diff --git a/src/view.js b/src/view.js index 1027f65b29..3011a25999 100644 --- a/src/view.js +++ b/src/view.js @@ -34,6 +34,7 @@ this, this.screen.exclude_field, field_attrs) .parse(xml.children()[0]); } + this.reset(); }, set_value: function() { }, @@ -55,6 +56,8 @@ get_buttons: function() { return []; }, + reset: function() { + }, }); Sao.View.idpath2path = function(tree, idpath) { diff --git a/src/view/tree.js b/src/view/tree.js index 25b2767891..0ca82eaf85 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -89,6 +89,7 @@ view_type: 'tree', xml_parser: Sao.View.TreeXMLViewParser, draggable: false, + display_size: Sao.config.display_size, init: function(view_id, screen, xml, children_field) { this.children_field = children_field; this.sum_widgets = {}; @@ -211,7 +212,8 @@ this.table.append(this.tbody); this.set_drag_and_drop(); - + }, + reset: function() { this.display_size = Sao.config.display_size; }, get editable() {