mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +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"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success(
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success(
|
||||
{_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"),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success(
|
||||
var jid = json.updatenetworkserviceproviderresponse.jobid;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2368,12 +2370,13 @@
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2398,12 +2401,13 @@
|
||||
args.response.success(
|
||||
{_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;
|
||||
args.response.success(
|
||||
{_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;
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
}
|
||||
{
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2828,12 +2834,13 @@
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2858,12 +2865,13 @@
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2957,12 +2965,13 @@
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -2987,12 +2996,13 @@
|
||||
args.response.success(
|
||||
{_custom:
|
||||
{
|
||||
jobId: jid
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(window).trigger('cloudStack.fullRefresh');
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -8,18 +8,20 @@
|
||||
var $newRow;
|
||||
var jsonObj = $row.data('json-obj');
|
||||
|
||||
$listView.listView('replaceItem', {
|
||||
$row: $row,
|
||||
data: $.extend(jsonObj, newData),
|
||||
after: function($newRow) {
|
||||
$detailView.data('list-view-row', $newRow);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
if($listView.length > 0 ) { //$listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh')
|
||||
$listView.listView('replaceItem', {
|
||||
$row: $row,
|
||||
data: $.extend(jsonObj, newData),
|
||||
after: function($newRow) {
|
||||
$detailView.data('list-view-row', $newRow);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Refresh detail view context
|
||||
$.extend(
|
||||
$detailView.data('view-args').context[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user