Created
November 13, 2014 11:46
-
-
Save lukeclifton/bfaaa8cea70824f89c90 to your computer and use it in GitHub Desktop.
formsubmitter function
This file contains 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
Template.customerCreate.rendered = function () { | |
$('.formsubmitter').click(function(e) { | |
e.preventDefault(); | |
var form = '#' + $(this).data('form-id'); | |
$(form).submit(); | |
}); | |
} |
ok, permission to hit me. i realise now that i can just get the form id from the event handler. i pasted the code from a previous non meteor project and didn't check it.
but yes agree with @richsilv, global rendered functions is still a need
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Incidentally, although it may not end up being relevant here, I do think there is call for global rendered/created/destroyed callbacks and have made the case on meteor-talk in the past. Not sure whether anything will happen, but I do think that there is a use case for this (even if it isn't this one), at least as a set of convenience methods.