Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $('#button').click({
  2. customData: 'foo'
  3. }, handlerFunction);
  4.  
  5. function handlerFunction(event) {
  6. console.log(event.data.customData);
  7. }
  8.  
  9. function make_event_handler(customData){
  10. return function(evt){
  11. //customData can be used here
  12. //just like any other normal variable
  13. console.log(customData);
  14. }
  15. }
  16.  
  17. dojo.connect(node, 'onclick', make_event_handler(17));
  18.  
  19. function event_handler(customData, evt){
  20. ///
  21. }
  22.  
  23. dojo.connect(node, 'onclick', dojo.partial(event_handler, 17))
  24.  
  25. this.connect(other, "onClick", function(e) {
  26. /* other is accesible here still */
  27. });
  28.  
  29. this.connect(other, "onClick", dojo.hitch(this, "handler", other);
  30.  
  31. this.handler = function(other, evt){...}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement