X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fextras%2FColReorder%2Fcol_filter.html;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fextras%2FColReorder%2Fcol_filter.html;h=eec910ceb4db22ab6f2e376d32ca0be5db6f84f6;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/extras/ColReorder/col_filter.html b/webapp/resources/datatables-1.9.4/extras/ColReorder/col_filter.html new file mode 100755 index 0000000..eec910c --- /dev/null +++ b/webapp/resources/datatables-1.9.4/extras/ColReorder/col_filter.html @@ -0,0 +1,588 @@ + + +
+ + + +This example of how to use ColReorder shows quite a number of different interesting + properties. Firstly, there is integration with ColVis, then there is the fact that there + is more than one row in the table header with the second being used for the input + elements, and finally of course the filtering itself. Note that it is important to use + the _fnVisibleToColumnIndex() internal function to calculate which column index should + be given to fnFilter (or you could employ your own methods).
+Please note that this demo requires DataTables 1.8 or later.
+ +$(document).ready(function() { + var oTable; + + /* Add the events etc before DataTables hides a column */ + $("thead input").keyup( function () { + /* Filter on the column (the index) of this element */ + oTable.fnFilter( this.value, oTable.oApi._fnVisibleToColumnIndex( + oTable.fnSettings(), $("thead input").index(this) ) ); + } ); + + /* + * Support functions to provide a little bit of 'user friendlyness' to the textboxes + */ + $("thead input").each( function (i) { + this.initVal = this.value; + } ); + + $("thead input").focus( function () { + if ( this.className == "search_init" ) + { + this.className = ""; + this.value = ""; + } + } ); + + $("thead input").blur( function (i) { + if ( this.value == "" ) + { + this.className = "search_init"; + this.value = this.initVal; + } + } ); + + oTable = $('#example').dataTable( { + "sDom": 'RC<"clear">lfrtip', + "aoColumnDefs": [ + { "bVisible": false, "aTargets": [ 2 ] } + ], + "oLanguage": { + "sSearch": "Search all columns:" + }, + "bSortCellsTop": true + } ); +} );+ + +