Add totals for number format values only
This commit is contained in:
@@ -237,7 +237,7 @@ jQuery(document).ready(function($){
|
||||
});
|
||||
|
||||
// Total stats calculator
|
||||
$(".sp-data-table .sp-total input").on("updateTotal", function() {
|
||||
$(".sp-data-table .sp-total input[data-sp-format=number]").on("updateTotal", function() {
|
||||
index = $(this).parent().index();
|
||||
var sum = 0;
|
||||
$(this).closest(".sp-data-table").find(".sp-post").each(function() {
|
||||
|
||||
@@ -252,8 +252,10 @@ class SP_Meta_Box_Event_Performance {
|
||||
$player_id = 0;
|
||||
$player_performance = sp_array_value( $data, $player_id, array() );
|
||||
$value = sp_array_value( $player_performance, $column, '' );
|
||||
$format = sp_array_value( $formats, $column, 'number' );
|
||||
$placeholder = sp_get_format_placeholder( $format );
|
||||
?>
|
||||
<td><input type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" placeholder="0" value="<?php echo esc_attr( $value ); ?>" /></td>
|
||||
<td><input type="text" name="sp_players[<?php echo $team_id; ?>][<?php echo $player_id; ?>][<?php echo $column; ?>]" placeholder="<?php echo trim( $placeholder ); ?>" value="<?php echo esc_attr( $value ); ?>" data-sp-format="<?php echo $format; ?>" /></td>
|
||||
<?php endforeach; ?>
|
||||
<?php if ( $status ) { ?>
|
||||
<td> </td>
|
||||
|
||||
Reference in New Issue
Block a user