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:
Jessica Wang 2012-02-20 14:44:57 -08:00
parent 1dfe656f2a
commit 65d9b60d42
2 changed files with 71 additions and 59 deletions

View File

@ -2173,12 +2173,13 @@
args.response.success(
{_custom:
{
jobId: jid
jobId: jid,
getUpdatedItem: function(json) {
$(window).trigger('cloudStack.fullRefresh');
}
}
}
);
$(window).trigger('cloudStack.fullRefresh');
}
});
},
@ -2203,12 +2204,13 @@
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');
}
});
},
@ -2590,12 +2594,13 @@
args.response.success(
{_custom:
{
jobId: jid
jobId: jid,
getUpdatedItem: function(json) {
$(window).trigger('cloudStack.fullRefresh');
}
}
}
);
$(window).trigger('cloudStack.fullRefresh');
}
});
},
@ -2620,12 +2625,13 @@
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');
}
});
},

View File

@ -8,6 +8,7 @@
var $newRow;
var jsonObj = $row.data('json-obj');
if($listView.length > 0 ) { //$listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh')
$listView.listView('replaceItem', {
$row: $row,
data: $.extend(jsonObj, newData),
@ -19,6 +20,7 @@
}, 100);
}
});
}
// Refresh detail view context
$.extend(