This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 2 years, 6 months ago.

Turkish charachter problem for datatable search box

  • emraheee

    Posts: 10
    Member Reply #7462

    when i use datatable search box, Turkish charachter

    “I”, capital of “ı”

    “İ”, capital of “i”

    makes problem.  for example: when i search for “iyi”, i can not find “İYİ”.

    if i use “datatable.js” (datatable.js of instead of  metronic “datatables.min.js”

    i change the

    var _fnEscapeRegex = DataTable.util.escapeRegex;

    function to

    var _fnEscapeRegex = function ( sVal ) {

    var letters = { “İ”: “[İi]”, “I”: “[Iı]”, “Ş”: “[Şş]”, “Ğ”: “[Ğğ]”, “Ü”: “[Üü]”, “Ö”: “[Öö]”, “Ç”: “[Çç]”, “i”: “[İi]”, “ı”: “[Iı]”, “ş”: “[Şş]”, “ğ”: “[Ğğ]”, “ü”: “[Üü]”, “ö”: “[Öö]”, “ç”: “[Çç]” };

    var acEscape = [ ‘/’, ‘.’, ‘*’, ‘+’, ‘?’, ‘|’, ‘(‘, ‘)’, ‘[‘, ‘]’, ‘{‘, ‘}’, ‘\\’, ‘$’, ‘^’, ‘-‘ ];

    var reReplace = new RegExp( ‘(\\’ + acEscape.join(‘|\\’) + ‘)’, ‘g’ );

    sVal=sVal.replace(reReplace, ‘\\$1’);

    return sVal.replace(/(([İIŞĞÜÇÖiışğüçö]))/g, function (letter) { return letters[letter]; });


    turkish charachter search work fine but i cannot user other metronic properties.

    How can i solve this problem.

    • This topic was modified 2 years, 6 months ago by  emraheee.

    Posts: 4527
    Support Staff Reply #7482

    Hi :),

    Thanks for contacting our support. To override default search method you can refer to below solution:

    Thus you can apply your own search function without having to modify the core search function.

    If you need any further clarifications please let us know.


    Just a friendly reminder: If you purchased Metronic 6 months ago then your included support subscription might be expired and to get any further support you will need to renew your support subscription. For further check please go to Metronic purchase page

    For more info please check: or



You must be logged in to reply to this topic.