Index: js/datatables.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/datatables/js/datatables.js,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 datatables.js
--- js/datatables.js	26 Oct 2010 23:43:08 -0000	1.1.4.3
+++ js/datatables.js	17 Jan 2011 09:46:32 -0000
@@ -66,6 +66,53 @@ Drupal.behaviors.datatables = {
           });
         });
       }
+
+      if (this.bColumnFilter) {
+        // Create necessary structure in the DOM.
+        var headerRow = table.find('thead tr').clone();
+        var tfoot = document.createElement('tfoot');
+        jQuery(tfoot).append(headerRow);
+        jQuery(tfoot).find('th').each(function (idx,th){
+          jQuery(th).removeClass();
+          var text = jQuery(th).text();
+          var inputName = text.toLowerCase().replace(/[ -]/g, '_');
+          jQuery(th).empty()
+             .append('<input type="text" class="search_init" value="' + text + '" name="' + inputName + '">');
+        });
+        jQuery(tfoot).find('input').css('width', '90%');
+        table.append(tfoot);
+
+        // Add necessary events to the newly created input fields.
+        var asInitVals = new Array();
+
+        table.find("tfoot input").keyup(function () {
+          /* Filter on the column (the index) of this element */
+          datatable.fnFilter( this.value, table.find("tfoot input").index(this) );
+        });
+
+        /*
+         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
+         * the footer
+         */
+        table.find("tfoot input").each(function (i) {
+          asInitVals[i] = this.value;
+        } );
+
+        table.find("tfoot input").focus(function () {
+          if ( this.className == "search_init" ) {
+            this.className = "";
+            this.value = "";
+          }
+        });
+
+        table.find("tfoot input").blur(function (i) {
+          if ( this.value == "" ){
+            this.className = "search_init";
+            this.value = asInitVals[table.find("tfoot input").index(this)];
+          }
+        });
+      }
+
     });
   }
 };
