Skip to content

Instantly share code, notes, and snippets.

@gelicia
Created August 7, 2012 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gelicia/3289089 to your computer and use it in GitHub Desktop.
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
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