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