diff --git a/www/default.js b/www/default.js
index 6f89c0ef..fb8116e2 100644
--- a/www/default.js
+++ b/www/default.js
@@ -35,6 +35,18 @@ function change_cost(duration) {
current_cost_duration = duration;
}
+function column_toggle_setup() {
+ // get column headings, add to filter button
+ $.each($("#data thead tr th"), function(i, elem) {
+ $("#filter-dropdown ul").append("
"+elem.innerText+"");
+ });
+
+ // toggle column buttons
+ $("#filter-dropdown ul.dropdown-menu li").bind("click", function(e) {
+ $(this).toggleClass("active");
+ });
+}
+
$(function() {
$(document).ready(function() {
$('#data').dataTable({
@@ -60,6 +72,8 @@ $(function() {
});
change_cost('hourly');
+
+ column_toggle_setup();
});
$("#cost-dropdown li").bind("click", function(e) {
@@ -85,3 +99,10 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});
+
+// toggle columns
+function fnShowHide(iCol) {
+ var oTable = $('#data').dataTable();
+ var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
+ oTable.fnSetColumnVis( iCol, bVis ? false : true );
+}
\ No newline at end of file
diff --git a/www/index.html b/www/index.html
index eb3f652b..1afb1f82 100644
--- a/www/index.html
+++ b/www/index.html
@@ -38,6 +38,16 @@ EC2Instances.info Easy Amazon EC2 Instance Comparison
Yearly
+
+