Im using Tablepress wordpress plugin (I've already written code for "Press enter to search and hidden table and search speficic columns" ). Now I want EXACT WORD SEARCH i.e user will see results only when he types exact word/number.
Note: I've found some solutions here but don't understand where to place exactly
1. http://stackoverflow.com/questions/19114586/how-to-get-exact-match-using-fnfilter
2. http://www.datatables.net/forums/discussion/4096/filtering-an-exact-match/p1
HERE IS THE LINK: http://appache.no/hydor
<script type="text/javascript">
$(document).ready( function () {
var table =
$('#tablepress-1').dataTable( {
"aoColumnDefs": [
{
"bSearchable": false, "aTargets": [ 0,2,4,5,6,7,8]}
],"bLengthChange":false,"iDisplayLength":1 } );
window.alert = function() {};
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
return oSettings.oPreviousSearch.sSearch === '' ? false : true;
}
);
var DT_tablepress_1 = $('#tablepress-1').dataTable({"aaSorting":[],"bSortClasses":false,"asStripeClasses":[],"bSort":false,"bLengthChange":false,"iDisplayLength":1,"bInfo":false});
$('#tablepress-1_filter input').unbind().bind('keyup', function(e) {
if( 13 == e.keyCode )
DT_tablepress_1.fnFilter( this.value );
});
$( '.dataTables_filter' ).find( 'input' ).on( 'keyup', function(e) {
if( 13 == e.keyCode ) {
$( '.dataTables_wrapper' ).find( '.tablepress' ).toggle( '' != $(this).val() );
}
} );
$( '.dataTables_wrapper' ).find( '.tablepress' ).hide();
});
</script>