CLOUDSTACK-555:Uncaught TypeError: Cannot read property 0 of undefined in UI while navigating to ipAddresses section under VPC

This commit is contained in:
Pranav Saxena 2012-11-29 00:32:18 +05:30
parent 1d0a1adb8e
commit fb9c62ff1c

View File

@ -1263,11 +1263,21 @@
addRow: 'true',
preFilter: function(args) {
var zoneObj;
var dataObj = {};
if('vpc' in args.context) { //from VPC section
$.extend(dataObj, {
vpcid: args.context.vpc[0].id
});
}
else if('networks' in args.context) { //from Guest Network section
$.extend(dataObj, {
networkid: args.context.networks[0].id
});
}
$.ajax({
url: createURL('listZones'),
data: {
id: args.context.networks[0].zoneid
},
data: dataObj,
async: false,
success: function(json) {
zoneObj = json.listzonesresponse.zone[0];