[ADD] Added do_show and do_hide in views
bzr revid: fme@openerp.com-20110404153426-2vlz4n0s4v69b5o5
This commit is contained in:
parent
6dd76ea8f6
commit
345496d9a3
|
@ -43,8 +43,6 @@ openerp.base.FormView = openerp.base.Controller.extend(
|
|||
w.start();
|
||||
});
|
||||
this.$element.find('button.form_save').click(this.do_save);
|
||||
|
||||
this.dataset.fetch_index(this.fields_view.fields, this.on_record_loaded);
|
||||
},
|
||||
on_next: function() {
|
||||
this.dataset.next();
|
||||
|
@ -122,6 +120,13 @@ openerp.base.FormView = openerp.base.Controller.extend(
|
|||
// rpc - save.callbacl on_saved
|
||||
}
|
||||
},
|
||||
do_show: function () {
|
||||
this.dataset.fetch_index(this.fields_view.fields, this.on_record_loaded);
|
||||
this.$element.show();
|
||||
},
|
||||
do_hide: function () {
|
||||
this.$element.hide();
|
||||
},
|
||||
on_invalid: function() {
|
||||
},
|
||||
on_saved: function() {
|
||||
|
|
|
@ -76,6 +76,13 @@ openerp.base.ListView = openerp.base.Controller.extend({
|
|||
}));
|
||||
|
||||
},
|
||||
do_show: function () {
|
||||
// TODO: re-trigger search
|
||||
this.$element.show();
|
||||
},
|
||||
do_hide: function () {
|
||||
this.$element.hide();
|
||||
},
|
||||
do_search: function (domains, contexts, groupbys) {
|
||||
var self = this;
|
||||
this.rpc('/base/session/eval_domain_and_context', {
|
||||
|
|
|
@ -75,7 +75,11 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
|
|||
|
||||
for (var i in this.views) {
|
||||
if (this.views[i].controller) {
|
||||
this.views[i].controller.$element.toggle(i === view_type);
|
||||
if (i === view_type) {
|
||||
this.views[i].controller.do_show();
|
||||
} else {
|
||||
this.views[i].controller.do_hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
return view_promise;
|
||||
|
|
Loading…
Reference in New Issue