[ADD] Added do_show & do_hide in other views

bzr revid: fme@openerp.com-20110405081134-gavp25ezsqfrc63d
This commit is contained in:
Fabien Meghazi 2011-04-05 10:11:34 +02:00
parent c57a4c05a2
commit 70b995bb54
2 changed files with 24 additions and 22 deletions

View File

@ -100,28 +100,6 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base
// rpc - save.callbacl on_saved
}
},
do_search: function() {
if (!this.ready) {
return false;
}
var invalid = false;
var values = {};
for (var f in this.fields) {
f = this.fields[f];
if (f.invalid) {
invalid = true;
} else {
values[f.name] = f.value;
}
}
if (invalid) {
this.on_invalid();
} else {
console.log("Save form", values);
// TODO: save values via datarecord
// rpc - save.callbacl on_saved
}
},
do_show: function () {
this.dataset.fetch_index(this.fields_view.fields, this.on_record_loaded);
this.$element.show();

View File

@ -263,6 +263,12 @@ openerp.base.CalendarView = openerp.base.Controller.extend({
start: function () {
this._super();
this.$element.append('Calendar view');
},
do_show: function () {
this.$element.show();
},
do_hide: function () {
this.$element.hide();
}
});
@ -271,6 +277,12 @@ openerp.base.GanttView = openerp.base.Controller.extend({
start: function () {
this._super();
this.$element.append('Gantt view');
},
do_show: function () {
this.$element.show();
},
do_hide: function () {
this.$element.hide();
}
});
@ -282,6 +294,12 @@ openerp.base.TreeView = openerp.base.Controller.extend({
start: function () {
this._super();
this.$element.append('Tree view');
},
do_show: function () {
this.$element.show();
},
do_hide: function () {
this.$element.hide();
}
});
@ -290,6 +308,12 @@ openerp.base.GraphView = openerp.base.Controller.extend({
start: function () {
this._super();
this.$element.append('Graph view');
},
do_show: function () {
this.$element.show();
},
do_hide: function () {
this.$element.hide();
}
});