diff --git a/CHANGELOG b/CHANGELOG index fd75bbcd53..66452a39f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Manage optional column * Display the number of selected records * Humanize the count result * Add limit to search_count diff --git a/src/sao.js b/src/sao.js index 9eaf060900..b25b690769 100644 --- a/src/sao.js +++ b/src/sao.js @@ -856,6 +856,10 @@ var Sao = {}; }.bind(this)); return cell; }, + set_visible: function() { + }, + get_visible: function() { + }, favorite_click: function(e) { // Prevent activate the action of the row e.stopImmediatePropagation(); diff --git a/src/sao.less b/src/sao.less index 6878076cb8..f4fd64c3aa 100644 --- a/src/sao.less +++ b/src/sao.less @@ -427,11 +427,11 @@ img.icon { width: 100%; table-layout: fixed; - col.selection-state, col.favorite, col.draggable-handle { + col.selection-state, col.favorite, col.draggable-handle, col.optional { width: 30px; } - td.draggable-handle { + td.draggable-handle, td.optional { cursor: grab; > img { .center-block(); @@ -446,6 +446,16 @@ img.icon { > label.sortable { cursor: pointer; } + &.optional { + cursor: pointer; + overflow: visible; + + .dropdown { + input[type="checkbox"] { + margin-left: 5px; + } + } + } overflow: hidden; text-overflow: ellipsis; text-align: center; diff --git a/src/screen.js b/src/screen.js index b8f07a9637..0b59d9c73d 100644 --- a/src/screen.js +++ b/src/screen.js @@ -2280,4 +2280,5 @@ }.bind(this)); } }); + Sao.Screen.tree_column_optional = {}; }()); diff --git a/src/view/tree.js b/src/view/tree.js index e6825769df..9938c178e4 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -112,6 +112,10 @@ } this.view.columns.push(column); + if (attributes.optional) { + this.view.optionals.push(column); + } + if (attributes.sum) { var label = attributes.sum + Sao.i18n.gettext(': '); var sum = jQuery('