Title: [Repeatable Group] Wrong index adding/removing rows
Last modified: January 26, 2018

---

# [Repeatable Group] Wrong index adding/removing rows

 *  Resolved [cutox](https://wordpress.org/support/users/cutox/)
 * (@cutox)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/)
 * [Version: 2.3.0]
 * Adding / Removing rows doesn’t update row index.
 * This problem affects data-iterator attribute and inputs’ id.
 * This can cause wrong behavior:
    If using timepicker in a group, you can’t update
   the correct field after row deletion.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/#post-9906147)
 * Can you provide the CMB2 metabox configuration that you’re using, so we can try
   to recreate what you’re experiencing?
 *  Thread Starter [cutox](https://wordpress.org/support/users/cutox/)
 * (@cutox)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/#post-9906843)
 *     ```
       	$cmb_call = new_cmb2_box( array(
       		'id'            => 'call_metabox',
       		'title'         => __( 'Calendario', 'cmb2' ),
       		'object_types'  => array( 'call' ),
       		'context'       => 'normal',
       		'priority'      => 'high',
       		'show_names'    => true,
       	) );
   
       	$cmb_call_date_group = $cmb_call->add_field( array(
       	    'id'          => '_call_calendar',
       	    'type'        => 'group',
       	    'escape_cb' => false,
       	    'repeatable'  => true,
        	    'options'     => array(
       	        'group_title'   => __( 'Sessione {#}', 'cmb' ), // since version 1.1.4, {#} gets replaced by row number
       	        'add_button'    => __( 'Aggiungi', 'cmb' ),
       	        'remove_button' => __( 'Rimuovi', 'cmb' ),
       	        'closed'    	=> false,
       	        'sortable'      => true, // beta
        	    ),
        	    'sortable' =>true
       	) );
   
       	$cmb_call->add_group_field( $cmb_call_date_group, array(
       		'name' => __( 'DateTime', 'cmb2' ),
        		'id'   => 'session',
       		'type' => 'text_datetime_timestamp',
       		'date_format' => 'Y-m-d',
       		'time_format' => 'H:i',
       	));
       ```
   
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/#post-9907894)
 * Definitely managing to recreate, and from the looks of things, very similar to
   this issue [https://github.com/CMB2/CMB2/issues/707](https://github.com/CMB2/CMB2/issues/707)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/#post-9907898)
 * Workarounds is frequent saving to get things “realigned” for the moment.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Repeatable Group] Wrong index adding/removing rows’ is closed to new
replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

## Tags

 * [repeatable group](https://wordpress.org/support/topic-tag/repeatable-group/)

 * 4 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/repeatable-group-wrong-index-adding-removing-rows/#post-9907898)
 * Status: resolved