diff --git a/Gruntfile.js b/Gruntfile.js index a908a91..375983b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -53,7 +53,8 @@ module.exports = function(grunt) { all: { options: { urls: [ - 'http://localhost:3001/test/methods/_getOrderedList.html' + 'http://localhost:3001/test/methods/_getOrderedList.html', + 'http://localhost:3001/test/methods/_rollUp.html' ] } } diff --git a/dist/dimple.v1.js b/dist/dimple.v1.js index 17f323b..f1edbfc 100644 --- a/dist/dimple.v1.js +++ b/dist/dimple.v1.js @@ -3416,25 +3416,6 @@ var dimple = { // Source: /src/methods/_rollUp.js dimple._rollUp = function (data, fields) { - // Get a squashed list. This will have a row - // for every distinct combination of fields passed - // and each field in the data will be included with an array of - // all values in its place. Therefore - // { "Field 1":"a", "Field 2":"x", "Field 3":"s", "Field 4":13 }, - // { "Field 1":"a", "Field 2":"y", "Field 3":"s", "Field 4":14 }, - // { "Field 1":"a", "Field 2":"z", "Field 3":"t", "Field 4":15 } - - // If fields = "Field 1" then this would return: - // { "Field 1":"a", "Field 2":["x","y","z"], "Field 3":["s","s","t"], "Field 4":[12,14,15]} - - // If fields = "Field 3" then this would return: - // { "Field 3":"s", "Field 1":["a","a"], "Field 2":["x","y"], "Field 4":[12,14]}, - // { "Field 3":"t", "Field 1":["a"], "Field 2":["z"], "Field 4":[15]} - - // If fields = ["Field 1", "Field 3"] then this would return: - // { "Field 1":"a", "Field 3":"s", "Field 2":["x","y"], "Field 4":[12,14]}, - // { "Field 1":"a", "Field 3":"t", "Field 2":["z"], "Field 4":[15]} - var returnList = []; // Put single values into single value arrays if (fields !== null && fields !== undefined) { diff --git a/src/methods/_rollUp.js b/src/methods/_rollUp.js index 48fc19d..f7f430a 100644 --- a/src/methods/_rollUp.js +++ b/src/methods/_rollUp.js @@ -3,25 +3,6 @@ // Source: /src/methods/_rollUp.js dimple._rollUp = function (data, fields) { - // Get a squashed list. This will have a row - // for every distinct combination of fields passed - // and each field in the data will be included with an array of - // all values in its place. Therefore - // { "Field 1":"a", "Field 2":"x", "Field 3":"s", "Field 4":13 }, - // { "Field 1":"a", "Field 2":"y", "Field 3":"s", "Field 4":14 }, - // { "Field 1":"a", "Field 2":"z", "Field 3":"t", "Field 4":15 } - - // If fields = "Field 1" then this would return: - // { "Field 1":"a", "Field 2":["x","y","z"], "Field 3":["s","s","t"], "Field 4":[12,14,15]} - - // If fields = "Field 3" then this would return: - // { "Field 3":"s", "Field 1":["a","a"], "Field 2":["x","y"], "Field 4":[12,14]}, - // { "Field 3":"t", "Field 1":["a"], "Field 2":["z"], "Field 4":[15]} - - // If fields = ["Field 1", "Field 3"] then this would return: - // { "Field 1":"a", "Field 3":"s", "Field 2":["x","y"], "Field 4":[12,14]}, - // { "Field 1":"a", "Field 3":"t", "Field 2":["z"], "Field 4":[15]} - var returnList = []; // Put single values into single value arrays if (fields !== null && fields !== undefined) { diff --git a/test/methods/_rollUp.html b/test/methods/_rollUp.html new file mode 100644 index 0000000..9e54541 --- /dev/null +++ b/test/methods/_rollUp.html @@ -0,0 +1,141 @@ + + + + + Test dimple.js + + + +
+
+ + + + + + \ No newline at end of file