+ onDeploymentChange: function(e) {
+ var deploymentID = this.$el.find("#field_deployment").val();
+
+ //console.log("onDeploymentChange");
+
+ filterFunc = function(model) { for (index in xos.siteDeployments.models) {
+ site_deployment = xos.siteDeployments.models[index];
+ if (site_deployment.attributes.id == model.attributes.site_deployment) {
+ return (site_deployment.attributes.deployment == deploymentID);
+ }
+ }
+ return false;
+ // return (model.attributes.deployment==deploymentID); }
+ };
+ newSelect = idToSelect("node",
+ this.model.attributes.node,
+ this.model.foreignFields["node"],
+ "humanReadableName",
+ false,
+ filterFunc);
+ this.$el.find("#field_node").html(newSelect);
+
+ filterFunc = function(model) { for (index in model.attributes.deployments) {
+ if (model.attributes.deployments[index] == deploymentID) return true;
+ };
+ return false;
+ }
+ newSelect = idToSelect("flavor",
+ this.model.attributes.flavor,
+ this.model.foreignFields["flavor"],
+ "humanReadableName",
+ false,
+ filterFunc);
+ this.$el.find("#field_flavor").html(newSelect);
+
+ filterFunc = function(model) { for (index in model.attributes.deployments) {
+ if (model.attributes.deployments[index] == deploymentID) return true;
+ };
+ return false;
+ };
+ newSelect = idToSelect("image",
+ this.model.attributes.image,
+ this.model.foreignFields["image"],
+ "humanReadableName",
+ false,
+ filterFunc);
+ this.$el.find("#field_image").html(newSelect);
+ },