diff --git a/weight.module b/weight.module index e466f6f..68aca3d 100644 --- a/weight.module +++ b/weight.module @@ -17,7 +17,10 @@ function weight_preprocess_views_view_table(&$variables) { foreach ($variables['rows'] as $key => $row) { $variables['rows'][$key]['attributes']->addClass('draggable'); } - $table_id = 'weight-table-' . $variables['view']->dom_id; + // The row key identify in an unique way a view grouped by a field, + // otherwise all the groups will share the same table_id and just the + // first table can be draggable. + $table_id = 'weight-table-' . $variables['view']->dom_id . '-row-' . $key; $variables['attributes']['id'] = $table_id; $options = [