From cd4b2fc18da4e8054b1ce156c064f865419cc060 Mon Sep 17 00:00:00 2001 From: Garret Heaton Date: Fri, 23 Nov 2012 10:05:00 -0800 Subject: [PATCH] Update costs properly after changing filter --- www/default.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/default.js b/www/default.js index 54cf9197..6f89c0ef 100644 --- a/www/default.js +++ b/www/default.js @@ -1,3 +1,5 @@ +var current_cost_duration = null; + function change_cost(duration) { // update menu text var first = duration.charAt(0).toUpperCase(); @@ -30,6 +32,7 @@ function change_cost(duration) { elem.text("$" + per_time + " " + duration); }); + current_cost_duration = duration; } $(function() { @@ -42,7 +45,13 @@ $(function() { "aTargets": ["memory", "computeunits", "storage", "ioperf"], "sType": "span-sort" } - ] + ], + "fnDrawCallback": function() { + // Whenever the table is drawn, update the costs. This is necessary + // because the cost duration may have changed while a filter was being + // used and so some rows will need updating. + change_cost(current_cost_duration); + } }); });