Skip to content

Instantly share code, notes, and snippets.

@ranic
Created January 3, 2020 22:34
Show Gist options
  • Save ranic/249158cf08ae1ec1b115df2bec81e00d to your computer and use it in GitHub Desktop.
Save ranic/249158cf08ae1ec1b115df2bec81e00d to your computer and use it in GitHub Desktop.
backbone1.js
Orchestrator = Backbone.View.extend({
// ...
render: function() {
// render subviews datePicker, graphSelector, etc.
// ...
this.listenTo(this.model, 'data-updated', function(data) {
this.tableWidget.update(data);
});
this.listenTo(this.datePicker, 'daterange-selected', function(dateAttrs) {
this.params.update(dateAttrs);
this.model.refresh(this.params);
});
this.listenTo(this.graphSelector, 'item-selected', function(itemAttrs) {
this.params.update(itemAttrs);
this.datePicker.reset();
this.model.refresh(this.params);
});
},
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment