r3573 newest attempt at the combobox.
authorRyan Farrington <gwyden@dreamflyght.com>
Tue, 11 May 2010 16:09:24 +0000 (16:09 +0000)
committerRyan Farrington <gwyden@dreamflyght.com>
Tue, 11 May 2010 16:09:24 +0000 (16:09 +0000)
inc/interface.php
popup.php

index 67991a486cbb71f13b899afb5c080098f29aa7bb..3c57c3e8768f83df2c353bf06ff48708f4254297 100644 (file)
@@ -798,9 +798,10 @@ function comboFromSelect ($elem_ids = array())
        {
                echo "var z${i}=dhtmlXComboFromSelect('${elem_id}');";
                echo "z${i}.enableFilteringMode(true);";
+               echo "z${i}.enableOptionAutoPositioning();";
                echo "z${i}.attachEvent('onKeyPressed', function(keyCode){ z${i}.enableFilteringMode(true); });";
-               echo "z${i}.attachEvent('onOpen', function(){ z${i}.enableFilteringMode(false); });";
-//             echo "z${i}.enableOptionAutoHeight(true);";
+               echo "z${i}.attachEvent('onOpen', function(){ window.setTimeout(function(){var text = z${i}.getComboText();z${i}.setComboText('');z${i}.filterSelf();z${i}.setComboText(text);})});";
+               echo "z${i}.enableOptionAutoHeight(true, 250);";
 //             echo "z${i}.readonly(true);";
                $i++;
        }
index 6aaf66f8964e8a29579ffd6d9475f9775297c94a..605eee548408eb946099cb01f01d16e4aef65684 100644 (file)
--- a/popup.php
+++ b/popup.php
@@ -95,8 +95,8 @@ header ('Content-Type: text/html; charset=UTF-8');
                        }
                        $spare_ports = findSparePorts ($port_id, $only_racks);
 
-                       printSelect ($spare_ports, array ('name' => 'ports', 'id' => 'ports'), Null, true);
-
+                       printSelect ($spare_ports, array ('name' => 'ports', 'id' => 'ports'));
+                       comboFromSelect (array ('ports'));
                        echo '<br><br>';
                        echo "<input type='submit' value='Link' onclick='".
                        "if (getElementById(\"ports\").value != \"\") {".