Dovetail Agent Behaviors
May 28, 2015
As Views become more and more complex, the View becomes less about displaying model data, and more about interactions. These interactions tend to be chunks of logic that need to be used in multiple views. In Dovetail Agent and Dovetail SelfService, Marionette Behaviors are used to apply this logic to view elements. What is a Behavior? In the Dovetail applications, there are behaviors that apply code to elements and patterns that are repeated frequently. One of the best examples in Dovetail Agent is the Date Picker. The Date Picker behavior sets up a date picker control for each element that contains a 'date-picker' class. The value of the picker is synced to the view's model with the attribute being the same name as the id of the picker. What that means is that for any input field in a form…