--- elements.module	2009-12-02 06:22:11.000000000 -0500
+++ elements2.module	2010-03-23 14:17:28.000000000 -0400
@@ -9,6 +9,7 @@ function elements_elements() {
     '#input' => TRUE,
     '#js_select' => TRUE,
     '#multiple' => TRUE,
+    '#sort_by_weights'=>FALSE,
     '#process' => array('form_process_tableselect'),
     '#options' => array(),
     '#empty' => '',
@@ -78,9 +79,11 @@ function form_process_tableselect($eleme
       $element['#default_value'] = array();
     }
 
-    // Sort the options by their #weight if they have a #weight.
-    uasort($element['#options'], 'element_sort');
-
+    // Sort the options by their #weight if we are supposed to.
+   
+     if ($element['#sort_by_weights']){
+       uasort($element['#options'], 'element_sort');
+     }
     // Create a checkbox or radio for each item in #options in such a way that
     // the value of the tableselect element behaves as if it had been of type
     // checkboxes or radios.
