Skip to content

Commit 008fcb8

Browse files
author
Jessica Wang
committed
cloudstack 3.0 UI - listView - when clicking fast between different rows, JS error "args.context.xxx is undefined" appears. e.g. "args.context.instances is undefined" appears when clicking fast between different rows in listView in instance page. Because when clicking fast, users might click another row before API response for this current row is back => which causes the JS error. The fix is to overlay the whole listView by loading image (spinning wheel image) until click-handling for this row is done (e.g. API response is back).
1 parent ae1858d commit 008fcb8

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎ui/scripts/ui/widgets/listView.js‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,9 @@
13121312

13131313
// Click on first item will trigger detail view (if present)
13141314
if (detailViewPresent && !uiCustom && !$target.closest('.empty, .loading').size()) {
1315+
var $loading = $('<div>').addClass('loading-overlay');
1316+
$target.closest('div.data-table').prepend($loading); //overlay the whole listView, so users can't click another row until click-handling for this row is done (e.g. API response is back)
1317+
13151318
listViewData.detailView.$browser = args.$browser;
13161319
detailViewArgs = {
13171320
$panel: $target.closest('div.panel'),
@@ -1347,9 +1350,14 @@
13471350
});
13481351
}
13491352

1350-
createDetailView(detailViewArgs, function($detailView) {
1351-
$detailView.data('list-view', $listView);
1352-
}, $target.closest('tr'));
1353+
createDetailView(
1354+
detailViewArgs,
1355+
function($detailView) { //complete(), callback funcion
1356+
$detailView.data('list-view', $listView);
1357+
$loading.remove();
1358+
},
1359+
$target.closest('tr')
1360+
);
13531361

13541362
return false;
13551363
}

0 commit comments

Comments
 (0)