[ADD] Added do_show & do_hide in other views
bzr revid: fme@openerp.com-20110405081134-gavp25ezsqfrc63d
This commit is contained in:
parent
c57a4c05a2
commit
70b995bb54
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue