Created
January 27, 2016 18:18
-
-
Save kjohnson/e59d06d162451d229e36 to your computer and use it in GitHub Desktop.
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
var myCustomFieldController = Marionette.Object.extend( { | |
initialize: function() { | |
// ... | |
}, | |
validate: function( model ) { | |
// ... | |
// Do Validation Here... | |
// If validation fails... | |
var modelID = model.get( 'id' ); | |
var errorID = 'custom-field-error'; | |
var errorMessage = 'This is an error message'; | |
var fieldsChannel = Backbone.Radio.channel( 'fields' ); | |
// Add Error | |
fieldsChannel.request( 'add:error', modelID, errorID, errorMessage ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment