[IMP] Initialisation of the sidebar.
bzr revid: nicolas.vanhoren@openerp.com-20110401121042-abg9zo1ldgwde0ht
This commit is contained in:
parent
7d1de96569
commit
63bf45372b
|
@ -37,8 +37,16 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
|
|||
this.search_visible = true;
|
||||
// this.views = { "list": { "view_id":1234, "controller": instance} }
|
||||
this.views = {};
|
||||
this.sidebar = new openerp.base.Sidebar(null);
|
||||
},
|
||||
start: function() {
|
||||
this.$element.find('.view-manager-main-sidebar').html(this.sidebar.render());
|
||||
this.sidebar.start();
|
||||
},
|
||||
stop: function() {
|
||||
// should be replaced by automatic destruction implemented in BaseWidget
|
||||
this.sidebar.stop();
|
||||
this._super();
|
||||
},
|
||||
on_mode_switch: function(view_type) {
|
||||
for (var i in this.views) {
|
||||
|
@ -229,6 +237,11 @@ openerp.base.BaseWidget = openerp.base.Controller.extend({
|
|||
}
|
||||
});
|
||||
|
||||
openerp.base.Sidebar = openerp.base.BaseWidget.extend({
|
||||
template: "ViewManager.sidebar"
|
||||
|
||||
});
|
||||
|
||||
openerp.base.CalendarView = openerp.base.Controller.extend({
|
||||
// Dhtmlx scheduler ?
|
||||
});
|
||||
|
|
|
@ -125,19 +125,27 @@
|
|||
</div>
|
||||
</t>
|
||||
<t t-name="ViewManager">
|
||||
<!-- TODO prefix id with the element_id of the controller t-attf-id="#{prefix}_localid" -->
|
||||
<div style="text-align:right;">
|
||||
<!--
|
||||
<input t-foreach="views" t-as="view" t-att-id="" t-att-value="view[1]"/>
|
||||
-->
|
||||
<t t-foreach="views" t-as="view">
|
||||
<input t-attf-id="#{prefix}_button_#{view[1]}" type="button" t-att-value="view[1]"/>
|
||||
</t>
|
||||
</div>
|
||||
<div t-attf-id="#{prefix}_search"></div>
|
||||
<t t-foreach="views" t-as="view">
|
||||
<div t-attf-id="#{prefix}_view_#{view[1]}"></div>
|
||||
</t>
|
||||
<table class="view-manager-main-table">
|
||||
<tr>
|
||||
<td class="view-manager-main-content">
|
||||
<!-- TODO prefix id with the element_id of the controller t-attf-id="#{prefix}_localid" -->
|
||||
<div style="text-align:right;">
|
||||
<!--
|
||||
<input t-foreach="views" t-as="view" t-att-id="" t-att-value="view[1]"/>
|
||||
-->
|
||||
<t t-foreach="views" t-as="view">
|
||||
<input t-attf-id="#{prefix}_button_#{view[1]}" type="button" t-att-value="view[1]"/>
|
||||
</t>
|
||||
</div>
|
||||
<div t-attf-id="#{prefix}_search"></div>
|
||||
<t t-foreach="views" t-as="view">
|
||||
<div t-attf-id="#{prefix}_view_#{view[1]}"></div>
|
||||
</t>
|
||||
</td>
|
||||
<td class="view-manager-main-sidebar">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</t>
|
||||
<t t-name="ListView">
|
||||
<!--
|
||||
|
@ -408,4 +416,9 @@
|
|||
<t t-name="SearchView.extended_search.proposition.char">
|
||||
<input t-att-id="element_id"/>
|
||||
</t>
|
||||
<t t-name="ViewManager.sidebar">
|
||||
<div t-att-id="element_id">
|
||||
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
Loading…
Reference in New Issue