Ah! jQuery to the rescue!
function custom_admin_js() {
global $get_all_statuses; ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
//Bring my $get_all_statuses array and encode it for jquery
var myObjects = <?php echo json_encode($get_all_statuses);?>;
//Run a each loop : jquery equivalent to php's foreach
$.each(myObjects, function (index, value) {
//console.log(index); //Status Label
//console.log(index); //Status-name
//count the WP list rows that has class names that matches your status name
// For example: <div class="status-col status-col-Published">Published</div>
var statct = $(".status-col-"+index).length,
allct = $(".status-col").length; // Target the class that is unique to count all rows.
//Update the value to the subsubsub element!
$('.subsubsub li.'+value+' .count').html(statct);
$('.subsubsub li.all .count').html(allct);
});
});
</script>
<?php
}
add_action('admin_footer', 'custom_admin_js', 1);