Skip to content
This repository has been archived by the owner on May 2, 2018. It is now read-only.

Tabledrag notes

holtzermann17 edited this page Sep 9, 2012 · 1 revision

Pulling these out of the code, since they just look sloppy there.

// make sure the "id" attribute is set

/* $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'collection-table'))); */
/* return $output; */

// In the theme function for the form, a special class must be added to
// each form element within the same column, "grouping" them together.
// ==> we use a single "weight" column to sort the table

/* $form['my_elements'][$delta]['weight']['#attributes']['class'] = array('my-elements-weight'); */

// give each row of the table the class "draggable" to enable the drag handles 

/* $row = array(...); */
/* $rows[] = array( */
/*   'data' => $row, */
/*   'class' => array('draggable'), */
/* ); */

//Rows with the 'tabledrag-leaf' class cannot have child rows.

// call this function
// args: $table_id, $action, $relationship, $group, $subgroup, $source, $hidden

/* drupal_add_tabledrag('collection-table', 'order', 'sibling', 'my-elements-weight',NULL,NULL,FALSE); */


////////////////////////////////////////////////////////////////////////////////////////