[IMP] Vieweditor:- improve xml of edit node view editor and init method of widget class

bzr revid: ysa@tinyerp.com-20111108130327-iozuye9ll7tgb2pq
This commit is contained in:
Yogesh (OpenERP) 2011-11-08 18:33:27 +05:30
parent 0cc4dd945b
commit d7213de315
2 changed files with 11 additions and 21 deletions

View File

@ -573,7 +573,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
this.edit_node_dialog = new openerp.web.Dialog(this,{
modal: true,
title: 'Properties',
width: 650,
width: 500,
height: 400,
buttons: {
"Update": function(){
@ -595,7 +595,7 @@ openerp.web.ViewEditor = openerp.web.Widget.extend({
this.edit_node_dialog.start().open();
var widget = _.keys(self.property.map);
var arch_val = self.get_object_by_id(clicked_tr_id,obj['main_object'],[]);
this.edit_node_dialog.$element.append('<table id="rec_table" class="oe_forms"></table>');
this.edit_node_dialog.$element.append('<table id="rec_table" style="width:400px" class="oe_forms"></table>');
this.edit_widget = [];
_.each(properties,function(record){
var id = record,
@ -667,10 +667,7 @@ openerp.web.ViewEditor.Field = openerp.web.Class.extend({
},
});
openerp.web.ViewEditor.FieldBoolean = openerp.web.ViewEditor.Field.extend({
init: function(view, node, id) {
this._super(view, node, id);
this.template = "view_boolean";
},
template : "vieweditor_boolean",
start: function() {
var self = this;
this.$element.find("input[id="+ self.name+"]").change(function() {
@ -692,13 +689,10 @@ openerp.web.ViewEditor.FieldBoolean = openerp.web.ViewEditor.Field.extend({
}
});
openerp.web.ViewEditor.FieldChar = openerp.web.ViewEditor.Field.extend({
init: function(view, node, id) {
this._super(view, node, id);
this.template = "view_char";
},
template : "vieweditor_char",
start: function () {
var self = this;
this.$element.find("input[id="+ this.name+"]").change(function() {
this.$element.find("input[id="+ this.name+"]").css('width','100%').change(function() {
self.on_ui_change();
});
},
@ -716,13 +710,10 @@ openerp.web.ViewEditor.FieldChar = openerp.web.ViewEditor.Field.extend({
}
});
openerp.web.ViewEditor.FieldSelect = openerp.web.ViewEditor.Field.extend({
init: function(view, node, id) {
this._super(view, node, id);
this.template = "view_selection";
},
template : "vieweditor_selection",
start: function () {
var self = this;
this.$element.find("select[id="+this.name+"]").change(function() {
this.$element.find("select[id="+ this.name +"]").css('width','100%').change(function() {
self.on_ui_change();
});
},

View File

@ -1330,14 +1330,13 @@
<t t-call="view_editor.row"/>
</t>
</tr>
<t t-name="view_char">
<t t-name="vieweditor_char">
<input type="text" t-att-id="widget.name" class="field_char" size="50"/>
</t>
<t t-name="view_selection">
<select style="width:366px" t-att-id="widget.name">
</select>
<t t-name="vieweditor_selection">
<select t-att-id="widget.name"/>
</t>
<t t-name="view_boolean">
<t t-name="vieweditor_boolean">
<input type="checkbox" t-att-id="widget.name"/>
</t>
<t t-name="ExportView">