Created
June 22, 2015 17:33
-
-
Save czbaker/12719e4437bed627fa1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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