Skip to content

Instantly share code, notes, and snippets.

@topherfangio
Created May 10, 2011 17:07
Show Gist options
  • Save topherfangio/964909 to your computer and use it in GitHub Desktop.
Save topherfangio/964909 to your computer and use it in GitHub Desktop.
Basic List/Example Views
ScHerestay.RentalUnitsIndex = SC.View.extend(SC.Control, {
childViews: 'list'.w(),
list: SC.ScrollView.design({
layout: {top: 10, left: 2, right: 2, buttom: 5},
contentView: SC.ListView.design({
layout: {top: 0, bottom: 0, left: 0, right: 0},
contentBinding: 'ScHerestay.rentalUnitsController.content',
exampleView: ScHerestay.UnitRow,
rowHeight: 50,
rowSpacing: 0
})
})
});
ScHerestay.UnitRow = SC.View.extend({
childViews: 'addressLabel avaibleButton contactButton'.w(),
addressLabel: SC.LabelView.design({
layout: {right: 0},
valueBinding: ".parentView.content.address"
}),
avaibleButton: SC.ButtonView.design({
layout: {width: '0.3'},
title: 'Availability'
}),
contactButton: SC.ButtonView.design({
layout: {width: '0.3', left: '0.31'},
title: "Contact"
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment