Skip to content

Instantly share code, notes, and snippets.

@thomaslang
Created August 27, 2009 13:00
Show Gist options
  • Save thomaslang/176269 to your computer and use it in GitHub Desktop.
Save thomaslang/176269 to your computer and use it in GitHub Desktop.
contentView: SC.ListView.design({
listItemActionProperty: 'actionClassName',
contentValueKey: "title",
contentBinding: "BB.associationListController.arrangedObjects",
//isEditable: YES,
//canReorderContent: YES,
exampleView: SC.ListItemView.extend({
renderAction: function(context, actionClassName){
context.push('<img src="',
SC.BLANK_IMAGE_URL,
'" class="action sc-mini-icon ',
actionClassName,
'" />');
},
mouseDown: function(evt) {
// if inside action icon
if (this._isInsideElementWithClassName('action', evt)) {
content = this.get('content') ;
if (content && content.performAction) {
content.performAction(this);
}
return NO; // should not be called on mouseUp
}
sc_super();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment