[IMP] web: add attribute searchview_hidden to views.

This attribute can be used when the view needs a searchview but wants it to be hidden.
This commit is contained in:
Martin Geubelle
2015-08-28 14:06:12 +02:00
parent 74beff7201
commit 39bc7871e1
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -16,10 +16,12 @@ var View = Widget.extend({
},
// name displayed in view switchers
display_name: '',
/**
* Define a view type for each view to allow automatic call to fields_view_get.
*/
// define a view type for each view to allow automatic call to fields_view_get.
view_type: undefined,
// used by views that need a searchview.
searchable: true,
// used by views that need a searchview but don't want it to be displayed.
searchview_hidden: false,
// multi_record is used to distinguish views displaying a single record
// (e.g. FormView) from those that display several records (e.g. ListView)
multi_record: true,
+1 -1
View File
@@ -183,7 +183,7 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
cp_content: _.extend({}, self.control_elements, view_control_elements),
hidden: self.flags.headless,
searchview: self.searchview,
search_view_hidden: view_controller.searchable === false,
search_view_hidden: view_controller.searchable === false || view_controller.searchview_hidden,
};
self.update_control_panel(cp_status);