Involver Developer Network : sml.tag.RegistrationCode
This page last changed on Jul 14, 2011 by rehan.iftikhar@involver.com.
sml.tag.RegistrationCodeAllows for programmatic assignment of codes via the RegistrationCode feature Instance Methods.requestCode(options)Requests a code from the given RegistrationCode feature. This will pop-up a dialog unless the onCodeAssigned callback is overridden. Options
Callbacks
ExampleRenders the partial with local variables:{% registration_code name:"bucket-default"%} <a href="#__" onclick="withNoCallbacks({{ registration_code.id }}); return false;">No callbacks (default behavior)</a> {% endregistration_code %} <br /> {% registration_code name:"bucket-assigned"%} <a href="#__" onclick="withCallbacks({{ registration_code.id }}); return false;">Code Assigned Callback</a> {% endregistration_code %} <script> function withNoCallbacks(feature_id) { new sml.tag.RegistrationCode().requestCode({feature_id: feature_id}); } function withCallbacks(feature_id) { new sml.tag.RegistrationCode().requestCode({ feature_id: feature_id, callbacks: { onCodeAssigned: function(data){ console.log("Here is data about your assigned code", data); }, onNoCodesLeft: function(data){ console.log("There are no codes left!") } } }); } </script> Related Topics |
![]() |
Document generated by Confluence on Feb 12, 2013 09:09 |