Search not working with cyrillic

QuestionsSearch not working with cyrillic
Svilen asked 5 years ago

Neither external nor default autosearch are working when using a mssql database with cyrillic elements.

PS:
If the method for connecting to the db is this one adding the last line would be a solution.

$serverName = “”; //serverName\instanceName
$connectionInfo = array( “Database”=>””,

“UID”=>””, “PWD”=>””,

“CharacterSet” => “UTF-8” ); <—- this line
$conn = sqlsrv_connect( $serverName, $connectionInfo);

5 Answers
Abu Ghufran Staff answered 5 years ago

Hello,

It’s fixed in latest build. We’re already using charset utf8 for mssql but the solution was to make it nvarchar compatible, which uses N’string pattern in search.

You can email me ([email protected]) your order number or payment email to get update.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Svilen answered 5 years ago

Okay great, will do.

Is there a way to do external search on 2 fields simultaneously?

Abu Ghufran Staff answered 5 years ago

Yes, thats doable with JS api and working demo is available in demos/search/search-form.php

PS: emailed you latest update for cyrillic character query.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Svilen answered 5 years ago

Autosearch got fixed, however, external search is still not properly working.

Here is the external search function (it is still working when the data and query are in English though). My guess is that the problem is not in the grid implementation, since autofilter is working properly, but rather in this function.

jQuery(“#search_text”).click(function() {
grid = jQuery(“#list1”);

// open initially hidden grid
// $(‘.ui-jqgrid-titlebar-close’).click();

var searchFilter = jQuery(“#filter”).val(), f;

if (searchFilter.length === 0)
{
grid[0].p.search = false;
jQuery.extend(grid[0].p.postData,{filters:””});
}
else
{
f = {groupOp:”OR”,rules:[]};

// initialize search, ‘name’ field equal to (eq) ‘Client 1’
// operators: [‘eq’,’ne’,’lt’,’le’,’gt’,’ge’,’bw’,’bn’,’in’,’ni’,’ew’,’en’,’cn’,’nc’]

f.rules.push({field:”NAME”,op:”bw”,data:searchFilter});
//f.rules.push({field:”invdate”,op:”bw”,data:searchFilter});

grid[0].p.search = true;

// if toolbar filter, keep in with external search form
if (grid[0].p.postData.filters != undefined && grid[0].p.postData.filters != ”)
{
var toolbar_filters = JSON.parse(grid[0].p.postData.filters);
var combine_filters = {groupOp:”AND”,rules:[],groups:[toolbar_filters,f]};
}
else
var combine_filters = f;

jQuery.extend(grid[0].p.postData,{filters:JSON.stringify(combine_filters)});
}

grid.trigger(“reloadGrid”,[{jqgrid_page:1,current:true}]);

return false;
})
jQuery(“#clear_text”).click(function() {
grid = jQuery(“#list1″);
grid[0].p.search = false;
jQuery.extend(grid[0].p.postData,{filters:””});

//removes get request
//window.location = window.location.href.split(“?”)[0];
// keeps get request
grid.trigger(“reloadGrid”,[{jqgrid_page:1,current:true}]);
return false;
});

Svilen answered 5 years ago

Nevermind, it is working now. The solution was when using 2 external searchbars, to first read the one with the cyrillic data.
Thanks.

Your Answer

7 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?