Advertisement
Guest User

Drupal tabledrag broken?

a guest
Dec 14th, 2010
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <?php
  2. $output = '';
  3. $output .= "This works:";
  4. $header = array('First name', 'Last name', 'Weight');
  5. $rows = array();
  6. $rows[] = array(
  7.   'data' =>array(
  8.     array('data' => 'Mark'),
  9.     array('data' => 'Smith'),
  10.     array('data' => '<div class="test-weight form-item">2</div>'),
  11.   ),
  12.   'class' => array('draggable'),
  13. );
  14. drupal_add_tabledrag('test-table', 'order', 'sibling', 'test-weight');
  15. $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'test-table')));
  16.  
  17. $output .= "This is broken:";
  18. $header = array('First name', 'Last name', 'Weight');
  19. $rows = array();
  20. $rows[] = array(
  21.   'data' =>array(
  22.     array('data' => 'Mark Smith', 'colspan' => 2),
  23.     array('data' => '<div class="test-weight form-item">2</div>'),
  24.   ),
  25.   'class' => array('draggable'),
  26. );
  27. drupal_add_tabledrag('test-table', 'order', 'sibling', 'test-weight');
  28. $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'test-table')));
  29. return $output;
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement