Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#button').click({
- customData: 'foo'
- }, handlerFunction);
- function handlerFunction(event) {
- console.log(event.data.customData);
- }
- function make_event_handler(customData){
- return function(evt){
- //customData can be used here
- //just like any other normal variable
- console.log(customData);
- }
- }
- dojo.connect(node, 'onclick', make_event_handler(17));
- function event_handler(customData, evt){
- ///
- }
- dojo.connect(node, 'onclick', dojo.partial(event_handler, 17))
- this.connect(other, "onClick", function(e) {
- /* other is accesible here still */
- });
- this.connect(other, "onClick", dojo.hitch(this, "handler", other);
- this.handler = function(other, evt){...}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement