Fix character-encoding problem with autocomplete
authorGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Thu, 6 Jan 2011 23:20:42 +0000 (00:20 +0100)
committerGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Thu, 6 Jan 2011 23:24:45 +0000 (00:24 +0100)
...And enforce some ajax call properties in js/ac_insert_row.js

ajax-ac-insert.php
js/ac_insert_row.js

index 49144a97bd54da6537245205fb8572dcfdf37db8..30679df61cd84a372f26c9f1aa7d3d8254a8a47b 100644 (file)
                echo "</tr>\n";
                $i=0;
                while ((!$res->EOF) && ($i < 11)) {
+                       $j=0;
                        echo "<tr class=\"acline\">";
                        foreach ($res->fields as $n => $v) {
+                               $finfo = $res->fetchField($j++);
                                if (in_array($n, $fkeynames))
-                                       echo "<td><a href=\"javascript:void(0)\" class=\"fkval\" name=\"{$keyspos[$n]}\">",htmlentities($v), "</a></td>";
+                                       echo "<td><a href=\"javascript:void(0)\" class=\"fkval\" name=\"{$keyspos[$n]}\">",
+                                               $misc->printVal($v, $finfo->type, array('clip' => 'collapsed')),
+                                               "</a></td>";
                                else
-                                       echo "<td><a href=\"javascript:void(0)\">", htmlentities($v), "</a></td>";
+                                       echo "<td><a href=\"javascript:void(0)\">",
+                                               $misc->printVal($v, $finfo->type, array('clip' => 'collapsed')),
+                                               "</a></td>";
                        }
                        echo "</tr>\n";
                        $i++;
index 6ac0bef2cc9bbb93eb7bbe07a5a94fafd3ef011e..d94edf5a6a698c711d31ebc44513a1de2d680df3 100644 (file)
@@ -77,6 +77,9 @@ function openlist(e) {
                url: 'ajax-ac-insert.php?server=' + server,
                type: 'post',
                data: datas,
+               dataType: 'html',
+               cache: false,
+               contentType: 'application/x-www-form-urlencoded',
                success: function (ret) {
                        jQuery.ppa.i = 0;
                        jQuery.ppa.fkbg.show();