Skip to content

Instantly share code, notes, and snippets.

@kuon
Created January 27, 2011 16:46
Show Gist options
  • Save kuon/798775 to your computer and use it in GitHub Desktop.
Save kuon/798775 to your computer and use it in GitHub Desktop.
list: SC.ScrollView.design({
layout:{width:250},
contentView: SC.ListView.design({
contentBinding:"Accounting.invoicesController.arrangedObjects",
selectionBinding:"Accounting.invoicesController.selection",
rowHeight:70,
exampleView:SC.View.design(SC.Control, {
classNames:"invoice-item",
displayProperties:'content.contact',
render:function (ctx) {
var c = this.get('content');
if(!c) return;
ctx.addClass('status_'+c.get('paymentStatus'));
ctx.push('<label class="number">',
c.get('number'),
'</label>',
'<label class="total">CHF ',
Accounting.formatCurrency(c.get('totalWithTax')),
'</label>',
'<label class="contact">',
c.getPath('contact.fullName'),
'</label>',
'<label class="sentDate">',
Accounting.formatDate(c.get('sentDate')),
'</label>');
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment