r3544 popup port selection no longer a long list but an autocomplete input box.
authorRyan Farrington <gwyden@dreamflyght.com>
Fri, 7 May 2010 13:09:24 +0000 (13:09 +0000)
committerRyan Farrington <gwyden@dreamflyght.com>
Fri, 7 May 2010 13:09:24 +0000 (13:09 +0000)
css/dhtmlxcombo.css
popup.php

index 96c3dd8ced9507263d257753876a0a5736f48172..89ec80b2b1a2949d72234c93e0ac52e1a0f07833 100644 (file)
@@ -32,6 +32,7 @@
        _height:22px;
        overflow:hidden;
     background-color: white;
+       margin: 0 auto;
 }
 
 .dhx_combo_list{
index f6cae67acda64adf97fe12d49c8b4088d3990056..1f8cade4c7a0c0dcaa467d8d237b757061dca331 100644 (file)
--- a/popup.php
+++ b/popup.php
@@ -83,7 +83,7 @@ header ('Content-Type: text/html; charset=UTF-8');
                        echo $localchoice ?
                                ('Nearest spare ports (<a href="popup.php?helper=portlist&port=' . $port_id . '&in_rack=n">show all</a>)') :
                                ('All spare ports (<a href="popup.php?helper=portlist&port=' . $port_id . '&in_rack=y">show nearest</a>)');
-                       echo '</h2><form action="javascript:;">';
+                       echo '</h2><form action="javascript:;" id="portform">';
                        $only_racks = array();
                        global $sic;
                        $port_info = getPortInfo ($sic['port']);
@@ -94,7 +94,16 @@ header ('Content-Type: text/html; charset=UTF-8');
                                        $only_racks = getProximateRacks ($object['rack_id'], getConfigVar ('PROXIMITY_RANGE'));
                        }
                        $spare_ports = findSparePorts ($port_id, $only_racks);
-                       printSelect ($spare_ports, array ('name' => 'ports', 'id' => 'ports', 'size' => getConfigVar ('MAXSELSIZE')));
+               echo "<script>";
+               echo "window.dhx_globalImgPath='/pix/';";
+               echo "</script>";
+               echo "<script src='js/dhtmlxcommon.js'></script>";
+               echo "<script src='js/dhtmlxcombo.js'></script>";
+               echo "<link rel='STYLESHEET' type='text/css' href='css/dhtmlxcombo.css'>";
+
+                       printSelect ($spare_ports, array ('name' => 'ports', 'id' => 'ports'));
+                       echo "<script>$(document).ready(function() {var z=dhtmlXComboFromSelect('ports');z.enableFilteringMode(true);})</script>";      
+
                        echo '<br><br>';
                        echo "<input type='submit' value='Link' onclick='".
                        "if (getElementById(\"ports\").value != \"\") {".