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

Turkish charachter problem for datatable search box


  • emraheee
    Participant

    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 datatables.net) 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 1 year, 9 months ago by  emraheee.
    Sean
    Sean
    Keymaster

    Posts: 4435
    Support Staff Reply #7482

    Hi :),

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

    http://yadcf-showcase.appspot.com/DOM_source.html

    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 http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes.

    For more info please check:

    https://help.market.envato.com/hc/en-us/articles/208191263-What-is-Item-Support- or http://themeforest.net/page/item_support_policy

    Thanks.

     

You must be logged in to reply to this topic.