Created
May 7, 2015 13:35
-
-
Save volodymyrlut/3d845ff1081d8061e66d to your computer and use it in GitHub Desktop.
WTF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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