bug 12901: cloudstack 3.0 new UI - system page - add host dialog - cluster dropdwon - show the current cluster as default selection.

This commit is contained in:
Jessica Wang 2012-01-06 11:53:01 -08:00
parent 1d73dd0947
commit 1e7a3702f5

View File

@ -5406,8 +5406,11 @@
success: function(json) {
clusterObjs = json.listclustersresponse.cluster;
var items = [];
$(clusterObjs).each(function() {
items.push({id: this.id, description: this.name});
$(clusterObjs).each(function() {
if(("clusters" in args.context) && (this.id == args.context.clusters[0].id))
items.unshift({id: this.id, description: this.name});
else
items.push({id: this.id, description: this.name});
});
args.response.success({data: items});
}