mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 13648: fix a bug in listView widget - $listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh'), calling $listView.listView will encounter an error when $listView.length is 0.
This commit is contained in:
parent
1dfe656f2a
commit
65d9b60d42
@ -2169,16 +2169,17 @@
|
|||||||
url: createURL("updateNetworkServiceProvider&id=" + nspMap["virtualRouter"].id + "&state=Enabled"),
|
url: createURL("updateNetworkServiceProvider&id=" + nspMap["virtualRouter"].id + "&state=Enabled"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2199,16 +2200,17 @@
|
|||||||
url: createURL("updateNetworkServiceProvider&id=" + nspMap["virtualRouter"].id + "&state=Disabled"),
|
url: createURL("updateNetworkServiceProvider&id=" + nspMap["virtualRouter"].id + "&state=Disabled"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2368,12 +2370,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2398,12 +2401,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2589,13 +2593,14 @@
|
|||||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
}
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2619,13 +2624,14 @@
|
|||||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
}
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2828,12 +2834,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2858,12 +2865,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2957,12 +2965,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2987,12 +2996,13 @@
|
|||||||
args.response.success(
|
args.response.success(
|
||||||
{_custom:
|
{_custom:
|
||||||
{
|
{
|
||||||
jobId: jid
|
jobId: jid,
|
||||||
|
getUpdatedItem: function(json) {
|
||||||
|
$(window).trigger('cloudStack.fullRefresh');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$(window).trigger('cloudStack.fullRefresh');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -8,18 +8,20 @@
|
|||||||
var $newRow;
|
var $newRow;
|
||||||
var jsonObj = $row.data('json-obj');
|
var jsonObj = $row.data('json-obj');
|
||||||
|
|
||||||
$listView.listView('replaceItem', {
|
if($listView.length > 0 ) { //$listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh')
|
||||||
$row: $row,
|
$listView.listView('replaceItem', {
|
||||||
data: $.extend(jsonObj, newData),
|
$row: $row,
|
||||||
after: function($newRow) {
|
data: $.extend(jsonObj, newData),
|
||||||
$detailView.data('list-view-row', $newRow);
|
after: function($newRow) {
|
||||||
|
$detailView.data('list-view-row', $newRow);
|
||||||
setTimeout(function() {
|
|
||||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Refresh detail view context
|
// Refresh detail view context
|
||||||
$.extend(
|
$.extend(
|
||||||
$detailView.data('view-args').context[
|
$detailView.data('view-args').context[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user