I'm experiencing a Turkish character issue with the grid search feature when using the OData V4 adaptor

I’m using the .NET OData V4 adapter with the EJ2 Grid in my JavaScript code. When I type the capital 'I' letter (used in Turkish) into the Grid’s searchText field, it sends it to the backend as a lowercase 'i'.

But in Turkish, the lowercase of 'I' is 'ı', not 'i'. Because of this, the record cannot be found in the SQL table.

This problem happens because English doesn’t have the 'ı' letter. I couldn’t find a solution for this issue.


Attachment: 14.06.2025_18.22.59_REC_e7ce00fd.png

1 Reply

SR Sivaranjani Rajasekaran Syncfusion Team June 17, 2025 04:08 AM UTC

Hi sekooo,

Greetings from syncfusion support!
The behavior you're encountering is due to the default character handling in JavaScript. When entering the capital letter 'I', JavaScript processes it based on English locale rules, where the lowercase equivalent is 'i'. However, in the Turkish locale, the correct lowercase of 'I' is 'ı', and this mismatch causes search queries to fail when matching against Turkish characters in your database.
To handle this scenario correctly, you need to normalize the search text to the Turkish locale using toLocaleLowerCase('tr') before triggering the search operation.
Please refer to the code below for more information:

Code Example : 

let gridSearchBox;
let isSearch = false;

grid.dataBound = function () {
  if (!gridSearchBox) {
    // Get the actual input element of the grid's search bar
    gridSearchBox = grid.element.querySelector('.e-search input');

    if (gridSearchBox) {
      gridSearchBox.addEventListener('keyup', function () {
        let inputVal = gridSearchBox.value;
        // Convert the input text to lowercase using the Turkish locale
        let normalizedValue = inputVal.toLocaleLowerCase('tr');
        isSearch = true;
        grid.search(normalizedValue);
      });
    }
  }
};

grid.actionBegin = function (args) {
  if (args.requestType === 'searching' && isSearch) {
    args.searchString = searchValue = args.searchString.toLocaleLowerCase('tr');
  }
};

grid.actionComplete = function (args) {
  if (args.requestType === 'searching') {
    isSearch = false;
  }
};

Screenshot:

Sample : Please find the sample attached

Please get back to us if you need further assistance.

Regards,
Sivaranjani R.

Attachment: JS_OdataV4_81c4636.zip

Loader.
Up arrow icon