From 1400429289063f16387eac4cfc76ecca912a6656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20K=C5=82ys?= Date: Fri, 12 Feb 2021 21:06:11 +0000 Subject: [PATCH] Adds ability to choose column for search --- features/alphabetSearch/dataTables.alphabetSearch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/alphabetSearch/dataTables.alphabetSearch.js b/features/alphabetSearch/dataTables.alphabetSearch.js index a43eabc..982c5dc 100644 --- a/features/alphabetSearch/dataTables.alphabetSearch.js +++ b/features/alphabetSearch/dataTables.alphabetSearch.js @@ -11,7 +11,7 @@ * @author SpryMedia Ltd (www.sprymedia.co.uk) * @contact www.sprymedia.co.uk/contact * @copyright Copyright 2014 SpryMedia Ltd. - * + * * License MIT - http://datatables.net/license/mit * * For more detailed information please see: @@ -49,7 +49,7 @@ $.fn.dataTable.ext.search.push( function ( context, searchData ) { return true; } - if ( searchData[0].charAt(0) === context.alphabetSearch ) { + if ( searchData[$.fn.dataTable.AlphabetSearch.column].charAt(0).toUpperCase() === context.alphabetSearch ) { return true; } @@ -83,7 +83,7 @@ function draw ( table, alphabet ) alphabet.empty(); alphabet.append( 'Search: ' ); - var columnData = table.column(0).data(); + var columnData = table.column($.fn.dataTable.AlphabetSearch.column).data(); var bins = bin( columnData ); $('')