Skip to content

Instantly share code, notes, and snippets.

@czbaker
Created June 22, 2015 17:33
Show Gist options
  • Select an option

  • Save czbaker/12719e4437bed627fa1b to your computer and use it in GitHub Desktop.

Select an option

Save czbaker/12719e4437bed627fa1b to your computer and use it in GitHub Desktop.
// Event Handler
Template.template.events({
'blur .order': function(event) {
var position = $(event.target).val();
Meteor.call('updateOrder', this, position, function(err) {
throw new Meteor.Error("Couldn't update record");
});
}
});
// Methods (store this in /lib, so latency compensation happens)
Meteor.methods({
updateOrder: function(doc, position) {
collection.update(this._id, {$set: {position: position}});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment