Skip to content

Instantly share code, notes, and snippets.

@kuon
Created January 27, 2011 17:49
Show Gist options
  • Save kuon/798878 to your computer and use it in GitHub Desktop.
Save kuon/798878 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, SC.ContentDisplay, {
contentDisplayProperties:"contact".w(),
classNames:"invoice-item",
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>');
}
})
})
})
@wagenet
Copy link

wagenet commented Jan 27, 2011

What I think i would do is:

contentPropertiesDidChange: function(){
  this.displayDidChange();
}.observes('*content.contact.fullName', ...)

and then remove your displayProperties stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment