@Leobaillard I think I got it.
Lines 76-81 of MMM-JCD-Bikes.js is the culprit. I believe that once you were going into Object.keys it was losing the scope. Try changing those lines to this:
// List available bikes via a stations array
var self = this;
Object.keys(self.stationsData).forEach(function (key)
{
table.appendChild(self.createStationNameRow(self.stationsData[key].name));
table.appendChild(self.createAmountRow(self.stationsData[key]));
});
note that I’ve added var self = this; and now calling these when appending children elements to the table: self.createStationNameRow, self.stationsData[key].name, self.createAmountRow and self.stationsData[key]
Another spot that I’ve noticed is that createStationNameRow function didn’t appendHTML name of the station to the cell. I didn’t dig too much into it, but I think this cell.innerHTML = name; was missing from it:
createStationNameRow: function(name) {
var nameRow = document.createElement("tr");
var cell = document.createElement("td");
cell.className = "stationName";
cell.setAttribute("colSpan", 2);
cell.innerHTML = name;
nameRow.appendChild(cell);
return nameRow;
},
Hopefully it will get you going in the right direction.
