Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- odoo.define('todo_ui.counter', function (require) {
- "use strict";
- var Widget = require('web.Widget');
- var Counter = Widget.extend({
- template: 'some.template',
- events: {
- 'click button': '_onClick',
- },
- init: function (parent, value) {
- this._super(parent);
- this.count = value;
- },
- _onClick: function () {
- this.count++;
- // console.log(this.count);
- this.$('.val').text(this.count);
- // console.log(this.$('.val').text());
- },
- });
- return {
- TodoCounter:Counter,
- };
- });
- start: function() {
- var self = this;
- var mycounter = mycounter.mycounter(this,1);
- return this._super.apply(this, arguments).then(function () {
- return self.render_search_view().then(function () {
- self.$el.html(self.html);
- mycounter.appendTo(self.$el.find('table'));
- });
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement