Skip to content

Instantly share code, notes, and snippets.

@brian-mann
Created July 18, 2012 22:31
Show Gist options
  • Select an option

  • Save brian-mann/3139398 to your computer and use it in GitHub Desktop.

Select an option

Save brian-mann/3139398 to your computer and use it in GitHub Desktop.
setting itemView with a switch
class Show.PointRowView extends Marionette.CompositeView
template: "folders/templates/dialogRegion/_point"
itemViewContainer: ".PointTypesContainer"
itemViewOptions: ->
PointTypeID: @model.get("PointTypeID")
eventpoint: @model.get("eventpoint")
tagName: "li"
className: "control-group"
constructor: (options) ->
switch options.model.get("PointTypeID")
when 0,1
@itemView = Show.PointRowValueView
when 2,3
@itemView = Show.PointRowConditionRowView
super(options)
initialize: ->
@collection = @model.get("conditions")
class Show.PointCategoryRowView extends Marionette.CompositeView
template: "folders/templates/dialogRegion/_pointcategory"
itemView: Show.PointRowView
itemViewContainer: "ul"
tagName: "fieldset"
initialize: ->
@collection = @model.get("points")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment