For an application for Field Collection I'm implementing, the order of fields is irrelevant, and it would be nice to be able to switch off display of field weight in the field Settings [I'd be quite happy with no reordering ability in this case.]

I guess it's possible to hide the page elements ("Show row weights", the + and table column, etc) in CSS: is there a better way?

Comments

Title:Field Collection Setting: enable/disable Weight?Field Collection Settings: Make weight optional.

There is no way to do this yet, but I think its a feature request worth noting.

I am not sure this is the best way to do it, but you could achieve this by overriding theme_field_multiple_value_form

Here's an example (change MY_THEME to the theme name and MY_FIELD_NAME to the name of the field) :

/**
* Implements theme_field_multiple_value_form().
*/
function MY_THEME_field_multiple_value_form($variables) {
  $element = $variables['element'];
  $output = '';
  // allows the disabling of the table drag for specif fields
  $draggable = !in_array($element['#field_name'], array('MY_FIELD_NAME'));
  if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
    $table_id = drupal_html_id($element['#field_name'] . '_values');
    $order_class = $element['#field_name'] . '-delta-order';
    $required = !empty($element['#required']) ? theme('form_required_marker', $variables) : '';
    $header = array(
      array(
        'data' => '<label>' . t('!title !required', array('!title' => $element['#title'], '!required' => $required)) . "</label>",
        'colspan' => 2,
        'class' => array('field-label'),
      ),
    );
    if($draggable){
      $header[] = t('Order');
    }
    $rows = array();
    // Sort items according to '_weight' (needed when the form comes back after
    // preview or failed validation)
    $items = array();
    foreach (element_children($element) as $key) {
      if ($key === 'add_more') {
        $add_more_button = &$element[$key];
      }
      else {
        $items[] = &$element[$key];
      }
    }
    usort($items, '_field_sort_items_value_helper');
    // Add the items as table rows.
    foreach ($items as $key => $item) {
      $item['_weight']['#attributes']['class'] = array($order_class);
      if(!$draggable){
        $item['_weight']['#attributes']['style'][] = 'display:none;';
      }
      $delta_element = drupal_render($item['_weight']);
      if($draggable){
        $cells = array(
          array(
            'data' => '',
            'class' => array('field-multiple-drag'),
          ),
          drupal_render($item),
          array(
            'data' => $delta_element,
            'class' => array('delta-order'),
          ),
        );
        $rows[] = array(
          'data' => $cells,
          'class' => array('draggable'),
        );
      }
      else{
        $cells = array(
          drupal_render($item) . $delta_element,
        );
        $rows[] = array(
          'data' => $cells,
        );
      }
    }
    $output = '<div class="form-item">';
    $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => $table_id, 'class' => array('field-multiple-table'))));
    $output .= $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '';
    $output .= '<div class="clearfix">' . drupal_render($add_more_button) . '</div>';
    $output .= '</div>';
    if($draggable){
      drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
    }
  }
  else {
    foreach (element_children($element) as $key) {
      $output .= drupal_render($element[$key]);
    }
  }
  return $output;
}

Issue summary:View changes

Clarification