filtering of select in sliverinline now working
[plstackapi.git] / planetstack / templates / admin / core / slice / change_form.html
index 035b730..c94b580 100644 (file)
@@ -7,6 +7,20 @@ deployment_nodes = [
    [{{ dn.0 }}, {{ dn.1 }} , "{{ dn.2 }}"],
 {% endfor %}
 ];
+
+function update_nodes(deployment_select, node_select_id) {
+    deployment_id = $(deployment_select).val();
+    html = "<option value=''>---------</option>\n";
+    for (i in deployment_nodes) {
+        dn = deployment_nodes[i];
+        if (dn[0] == deployment_id) {
+            html = html + '<option value="' + dn[1] + '">' + dn[2] + '</option>\n'
+        }
+    }
+    //console.log(html);
+    $("#"+node_select_id).empty().append(html);
+}
 </script>
+
 {% endblock %}