Combo with latin-2 chars

Hi!

First thanks for this great product!

I found a problem in the Dhtmlx Combo. Filtering with some latin-2 chars, for example: “íéáűúőöüó”, the autocomplete feature seems to fail. Sometime the options are visible for a moment, but they disappear, and there is no way to choose from the list, and also filtering for the next chars doesn’t work. So it seems, that the xml is interpreted, because of that short time, when the list is visible, but after a latin-2 char, the filtering stops working.
I’m use the 2.6 version.

Sorry for my bad english…

Thanks,


S

Hi,

such a problem may occur if you uses server filtering and the combo receives xml with options that are don’t correspond mask.

So, make sure that server-side script returns desired xml.

Hi!

Thanks! But it’s correspond to it. For example: search for stings begin with “tó”, results:

Tóbel Béla Tóbiás Gábor Tóbisz Tamás Tófalvi József Tófalvi Zoltán Tófehér Norbert

And combo crashes. Please help…


S

Hi,

please send the static xml file with the option that server-side return

My mistake. Our PHP framework modified, and the xml source getting latin-2 charset. Now it’s fixed to UTF-8, and combo works well. Sorry for taking Your time!

Thanks,


S

Sorry, but I was wrong. Still not work. I’m attached the xml. This is a result for a ‘So%’ mask, in a Accent Insensitive field. No mather how it works, from chache or from the xml, it’s making strange results.

Thanks again…

the file:
sanch.hu/so.txt


S

We have not reproduced the problem locally. Please have a look at the attached sample and try to use libraries from this demo in your application
demo.zip (22.7 KB)

Please try with: ‘Só’ and then type ‘d’ in your demo. When you filter to ‘Sód’, You wont get ‘Sódár…’, but all options reset to the state of filter for simple ‘S’. Thats the problem.

Thanks,


S

When you filter to ‘Sód’, You wont get 'Sódár - make sure that server-side script return the correct xml for this mask:

Dynamic loading requires that suggestions correspond mask.

Hello again!

Maybe I’m not realy understand. But for me it seems, that the result corresponds to the mask. I made a demo from one of Your samples.

devel.snt.hu/demo/

You can see, if You begin to filter fo ‘Á’ you wont get anything.

I uploaded the full source, with sql dump to:

devel.snt.hu/demo/demo.rar

Please help, I’m sure, that I’m failing, thats why I sending the source.

Thanks,


S

Also try to filter for ‘Ta’ and after press ‘d’ so try with ‘Tad’. Options looks weird.


S

We have entered Á in devel.snt.hu/demo/ and server-side script has not returned any option.
Here is the response:

<?xml version="1.0"?>

Combo sends data in the utf-8 encoding. So, you need to use utf-8 on the server-side too.

You may modify the following line in the dhtmlxcombo.js:

var url=this._xml+((this._xml.indexOf("?")!=-1)?"&":"?")+“pos=”+ind+"&mask="+encodeURIComponent(text);

as follows:

var url=this._xml+((this._xml.indexOf("?")!=-1)?"&":"?")+“pos=”+ind+"&mask="+text;

In this case the mask will be sent as is.
However, if user has typed a special character, the link may be broken…

If You enter Á then the next get query sended to the server:

devel.snt.hu/demo/filter.php?mask=Á

And if you try this url, you can see, that the answer of the script is a correct xml source.

You can try with A:

devel.snt.hu/demo/filter.php?mask=A

Same good xml. But the combo script cant handle the Á char. Sorry but looks like still can’t work with the latin-2 chars.


S

Your server-side script doesn’t return any option for the

devel.snt.hu/demo/filter.php?pos … 4141269284

request

How did it go with this problem?

My solution on this problem (being a user of swedish language) was to convert everything to UTF-8 encoding:

  1. First make sure your database contents are encoded in UTF-8
  2. Make sure you output your XML data in UTF-8
<?xml version="1.0" encoding="utf-8"?>

You might also have to override the encoding of your database output with UTF-8.
For me using PHP that means using the function utf8_encode():

<?php
// Decode the input searchstring that comes from the XML call by dhtmlXCombo
$searchstring = utf8_decode($_GET['mask']);

// Query the database
$query = "SELECT * FROM .... WHERE surname LIKE '" . $searchstring . "%'......";
$sql_get_contact = mysql_query($query);

// Create new XML document with ver 1.0 and also with encoding UTF-8
$xmldoc = new DomDocument('1.0', 'utf-8');

// Print out your results in to the XML DOM
while ($contact = mysql_fetch_assoc($sql_get_contact)) {
   // Override encoding of your output with UTF-8
   $contact = array_map('utf8_encode', $contact);

   // Do your XML DOM stuff here...
}

// Parse your XML document
echo $xmldoc->saveXML();

?>

I hope this helps someone. Took me over 2 hours to get everything up!

Thanks! Problem was: combo’s get using utf8 encoding. On php side an ut8_decode solved the problem. Thanks for all!

Greets,


S

Thanks! But this causes the problem. It’s an Hungarian_CI (MSSQL) table, and it’s an latin-2 project. I have this situlation, can’t modify DB parameters. But converting strings solved the problem.

Greets,


S