Created
August 7, 2012 20:40
-
-
Save gelicia/3289089 to your computer and use it in GitHub Desktop.
Miso Dataset - return elements of a dataset in a HTML list for viewing
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
Miso.DataView.prototype.printDVAsList = function() { | |
var outStr; | |
if (this.length > 0) { | |
outStr = "<ul>"; | |
var colNames = this.columnNames(); | |
this.each( | |
function (row){ | |
outStr = outStr + "<li>"; | |
for (var i = 0; i < colNames.length; i++) { | |
outStr = outStr + " <b>" + colNames[i] + "</b> - " + row[colNames[i]]; | |
}; | |
outStr = outStr + "</li>"; | |
} | |
); | |
outStr = outStr + "</ul>"; | |
} | |
return outStr; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment