diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index eb8def9819..c7006e962d 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -72,7 +72,8 @@ this.view.columns.push(column); if (attributes.optional) { - this.view.optionals.push(column); + Sao.setdefault( + this.view.optionals, column.attributes.name, []).push(column); } if (parseInt(attributes.sum || '0', 10)) { @@ -99,7 +100,7 @@ display_size: Sao.config.display_size, init: function(view_id, screen, xml, children_field) { this.children_field = children_field; - this.optionals = []; + this.optionals = {}; this.sum_widgets = new Map(); this.columns = []; this.selection_mode = (screen.attributes.selection_mode || @@ -254,7 +255,7 @@ this.set_drag_and_drop(); th = this.thead.find('th').first(); - if (this.optionals.length) { + if (!jQuery.isEmptyObject(this.optionals)) { th.addClass('optional'); } var menu = jQuery('