function createTableRows(geographyKeys){
var tableData=[];
var dataTypeKeys = ParameterService.selectedDataTypes();
var orderBy = ParameterService.selectedTableRowOrder();
if( orderBy == 'A' /* activity order */) {
/* ConfigService.getDataTypes() returns all the data types as an object with the id property as the key
* ParameterService.selectedDataTypes() returns the currently selected data types in an array
* Change this loop to loop over the selected data types as opposed to all data types
*/
angular.forEach(ParameterService.selectedDataTypes(), function (dataVal, index) { //for each data type in this entity
var dataKey = dataVal.id;
var dtHasData = false;
var baData = [];
var baInfo = {
title: dataVal.id,
code: dataVal.id,
api: 0
};
var fetchKey = key;
if (dataKey.substring(0, 4) == 'REG-') {
fetchKey = fetchKey.substring(4);
baInfo['title'] = ConfigService.getERs()[fetchKey].name + ' (region)';
}
baData.push(baInfo);
for (var x = 0; x < geographyKeys.length; x++) {//for each item
var key = geographyKeys[x];
var row = {
title: key,
code:key,
api:1,
datatype: dataKey
};
var currentDate = startDate.clone();
while (currentDate <= endDate) {
var theValue = DataService.getData(currentDate.format("YYYYMMDDTHH"), fetchKey, dataKey);
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.