Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. odoo.define('todo_ui.counter', function (require) {
  2. "use strict";
  3.  
  4. var Widget = require('web.Widget');
  5.  
  6. var Counter = Widget.extend({
  7. template: 'some.template',
  8. events: {
  9. 'click button': '_onClick',
  10. },
  11. init: function (parent, value) {
  12. this._super(parent);
  13. this.count = value;
  14. },
  15. _onClick: function () {
  16. this.count++;
  17. // console.log(this.count);
  18. this.$('.val').text(this.count);
  19. // console.log(this.$('.val').text());
  20. },
  21. });
  22.  
  23. return {
  24. TodoCounter:Counter,
  25. };
  26. });
  27.  
  28.  
  29. start: function() {
  30. var self = this;
  31. var mycounter = mycounter.mycounter(this,1);
  32. return this._super.apply(this, arguments).then(function () {
  33. return self.render_search_view().then(function () {
  34. self.$el.html(self.html);
  35. mycounter.appendTo(self.$el.find('table'));
  36. });
  37. });
  38. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement