Skip to content

Instantly share code, notes, and snippets.

@volodymyrlut
Created May 7, 2015 13:35
Show Gist options
  • Save volodymyrlut/3d845ff1081d8061e66d to your computer and use it in GitHub Desktop.
Save volodymyrlut/3d845ff1081d8061e66d to your computer and use it in GitHub Desktop.
WTF
WattAttack.module("RidesApp.Show", function (Show, WattAttack, Backbone, Marionette, $, _, Converters) {
Show.RideAnalysisWidget = Show.Widget.extend({
...
updateWidgetWithData: function () {
if (this.model.get("records")) {
this.setupRideData();
this.createChart();
this.render();
}
},
DataFunc: {
prepareLineChartData: function () {
//here I want to work with dataset
//Але тут у this поле dataset недоступне
}
},
createChart: function () {
var self = this;
console.log(self.dataset);
return self.chart;
},
setupRideData: function () {
var self = this;
var records = this.model.get('records');
...
this.dataset = [{
"key": "metrics",
"values": []
},
{
"key": "laps",
"values": []
}];
}
});
}, WattAttack.module('Common.Converters'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment