Skip to content

Instantly share code, notes, and snippets.

@topherfangio
Created March 6, 2011 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topherfangio/857615 to your computer and use it in GitHub Desktop.
Save topherfangio/857615 to your computer and use it in GitHub Desktop.
Pharos360.NavigationView = SC.View.extend({
myTestBinding: 'Pharos360.labelsController.arrangedObjects',
myTestDidChange: function() {
console.log('myTest did change');
this.displayDidChange();
}.observes('myTest.[]'),
render: function(context) {
sc_super();
console.log('render called');
var data = { sc_view:this };
var template = SC.TEMPLATES['navigation'];
context.push(template(data));
},
update: function(jquery) {
console.log('update called...');
var labels_html = "";
Pharos360.labelsController.forEach(function (label, index) {
labels_html += "<li class='label'>" + label.get('title') + "</li>";
});
jquery.find('ul.labels').html(labels_html);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment