Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. $.widget("bw.wijlinechartcursor", $.wijmo.wijlinechart, {
  2. _create: function () {
  3. var self = this;
  4. $.wijmo.wijlinechart.prototype._create.apply(self, arguments);
  5.  
  6. self.element.on("painted", function (e) {
  7. alert("Got painted in child via element.on"); // Doesn't get called.
  8. });
  9.  
  10. // This works, but blows away the client code's handler (below)
  11. self.options.painted = function (e) {
  12. alert("Got painted in child class via options.painted!");
  13. }
  14.  
  15. },
  16.  
  17. _painted: function () {
  18. alert("Got painted in child via _painted"); // Doesn't get called.
  19. }
  20. });
  21.  
  22. $("#mywijlinechartcursor").wijlinechartcursor({
  23. // ... stuff...
  24. painted: function (e) {
  25. alert("Got painted in client code");
  26. }
  27. });
  28.  
  29. self.element.on(self.widgetEventPrefix + "painted", function(e) {
  30. alert("Got painted in child via element.on"); // Should be called.
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement