CLOUDSTACK-8023: UI > VM wizard > service offering > trigger event handler of event "cloudStack.module.instanceWizard.serviceOffering.dataProvider" to get serviceOfferingObjs if module is enabled.

This commit is contained in:
Jessica Wang 2014-12-04 16:26:03 -08:00
parent 8927975ca9
commit 774394792e
1 changed files with 29 additions and 16 deletions

View File

@ -306,23 +306,36 @@
// if the user is leveraging a template, then we can show custom IOPS, if applicable
var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false);
$.ajax({
url: createURL("listServiceOfferings&issystem=false"),
dataType: "json",
async: true,
success: function(json) {
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
args.response.success({
canShowCustomIops: canShowCustomIopsForServiceOffering,
customFlag: 'iscustomized',
//customFlag: 'offerha', //for testing only
customIopsFlag: 'iscustomizediops',
data: {
serviceOfferings: serviceOfferingObjs
}
});
// get serviceOfferingObjs
$(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
$(window).trigger("cloudStack.module.instanceWizard.serviceOffering.dataProvider", {
context: args.context,
currentData: args.currentData
});
if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
$.ajax({
url: createURL("listServiceOfferings&issystem=false"),
dataType: "json",
async: false,
success: function(json) {
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
}
});
} else {
serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
}
args.response.success({
canShowCustomIops: canShowCustomIopsForServiceOffering,
customFlag: 'iscustomized',
//customFlag: 'offerha', //for testing only
customIopsFlag: 'iscustomizediops',
data: {
serviceOfferings: serviceOfferingObjs
}
});
});
},
// Step 4: Data disk offering