Ajax loaded chart didn't remove zero values; filtered values have correct odd/even colored rows

This commit is contained in:
tyron 2011-05-16 20:22:22 +02:00
parent 014a054c7f
commit f8656fb0f8
2 changed files with 15 additions and 2 deletions

View File

@ -1,6 +1,7 @@
$(function() {
var textFilter=null;
var alertFilter = false;
var odd_row=false;
// Filter options are invisible for disabled js users
$('#serverstatusvars fieldset').css('display','');
@ -25,12 +26,23 @@ $(function() {
});
function filterVariables() {
odd_row=false;
$('#serverstatusvariables th.name').each(function() {
if((textFilter==null || textFilter.exec($(this).text()))
&& (!alertFilter || $(this).next().find('span.attention').length>0))
&& (!alertFilter || $(this).next().find('span.attention').length>0)) {
odd_row = !odd_row;
$(this).parent().css('display','');
else
if(odd_row) {
$(this).parent().addClass('odd');
$(this).parent().removeClass('even');
} else {
$(this).parent().addClass('even');
$(this).parent().removeClass('odd');
}
} else {
$(this).parent().css('display','none');
}
});
}
});

View File

@ -26,6 +26,7 @@ require_once './libraries/chart.lib.php';
*/
if (isset($_REQUEST["query_chart_ajax"])) {
$com_vars = PMA_DBI_fetch_result("SHOW GLOBAL STATUS LIKE 'Com_%'", 0, 1);
arsort($com_vars);
// remove all zero values from the end
// variable empty for Drizzle
if ($com_vars) {