Reset display_size of TreeView when group is cleared or changed

This avoids to render unnecessary rows.

issue8918
review274591002
This commit is contained in:
Cédric Krier
2019-12-28 18:07:13 +01:00
parent 4b6ac16b92
commit 55ef710cd5
4 changed files with 13 additions and 1 deletions
+1
View File
@@ -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
+6
View File
@@ -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') &&
+3
View File
@@ -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) {
+3 -1
View File
@@ -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() {