Skip to content

Instantly share code, notes, and snippets.

@ejamesc
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save ejamesc/d66bc96cab130b653edc to your computer and use it in GitHub Desktop.

Select an option

Save ejamesc/d66bc96cab130b653edc to your computer and use it in GitHub Desktop.
Ext.define('App.someclass.SomeClass', {
someFunction: function(data) {
this.offers = someArrayOfOffers();
var blahCallback = (function (offers, context) {
return function(points){
for (var i = 0; i < points.length; i++) {
Ext.bind(context.onMarkerTap, context, offers[i], points[i])
}
}
})(this.offers, this); // in this case 'this' is a reference to the current class
// This function expects a callback that accepts an array of points
BMap.Convertor.translate(data, blahCallback);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment