Modifying diagram view to set label in diagram header
bzr revid: dhr@tinyerp.com-20120720132414-pdftmig39m3ro93b
This commit is contained in:
parent
52f6f0bd04
commit
bf7e2b0e76
|
@ -51,6 +51,9 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
var action = $(this).data('pager-action');
|
||||
self.on_pager_action(action);
|
||||
});
|
||||
this.labels = _.filter(this.fields_view.arch.children, function(label){
|
||||
return label.tag == "label" ;
|
||||
});
|
||||
|
||||
this.do_update_pager();
|
||||
|
||||
|
@ -104,11 +107,21 @@ instance.web.DiagramView = instance.web.View.extend({
|
|||
);
|
||||
},
|
||||
|
||||
get_label : function(){
|
||||
var self = this
|
||||
var html_label = _.each(self.labels,function(label){
|
||||
html_label = "<span>" + label.attrs.string + "</span>"
|
||||
self.$element.find('.oe_diagram_diagram_header').append(html_label)
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
on_diagram_loaded: function(record) {
|
||||
var id_record = record['id'];
|
||||
if(id_record) {
|
||||
this.id = id_record;
|
||||
this.get_diagram_info();
|
||||
this.get_label();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
</div>
|
||||
|
||||
<div class="diagram-container">
|
||||
<div class="oe_diagram_diagram_header"/>
|
||||
<div class="oe_diagram_diagram"/>
|
||||
</div>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue