From 4cc9d341580596a543b9ce3018b16d78fa332c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20K=C5=82ys?= Date: Sat, 13 Feb 2021 09:43:24 +0000 Subject: [PATCH] Defines parameters within options --- features/alphabetSearch/dataTables.alphabetSearch.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/features/alphabetSearch/dataTables.alphabetSearch.js b/features/alphabetSearch/dataTables.alphabetSearch.js index 2215c1f..a035754 100644 --- a/features/alphabetSearch/dataTables.alphabetSearch.js +++ b/features/alphabetSearch/dataTables.alphabetSearch.js @@ -147,6 +147,15 @@ function draw ( table, alphabet ) $.fn.dataTable.AlphabetSearch = function ( context ) { var table = new $.fn.dataTable.Api( context ); var alphabet = $('
'); + var options = $.extend({ + column: 0, + caseSensitive: false, + numbers: false + }, table.init().alphabet); + + $.fn.dataTable.AlphabetSearch.column = options.column; + $.fn.dataTable.AlphabetSearch.caseSensitive = options.caseSensitive; + $.fn.dataTable.AlphabetSearch.addNumbers = options.numbers; draw( table, alphabet ); @@ -185,7 +194,6 @@ $.fn.dataTable.AlphabetSearch = function ( context ) { }; $.fn.DataTable.AlphabetSearch = $.fn.dataTable.AlphabetSearch; -$.fn.dataTable.AlphabetSearch.column = 0; // Register a search plug-in $.fn.dataTable.ext.feature.push( {