Feature #2746: Add message to empty sched action table

This commit is contained in:
Carlos Martín committed 2014-03-13 18:53:24 +01:00
1 parent 387100cb72
commit 5996b813fe
1 file changed
+13 -1
+13 -1
View File
@@ -1853,7 +1853,15 @@ function printActionsTable(vm_info)
// Returns an HTML string with the json keys and values
function fromJSONtoActionsTable(actions_array){
var str = ""
if (!actions_array){ return "";}
var empty = '\
<tr id="no_actions_tr">\
<td colspan="6">' + tr("No actions to show") + '</td>\
</tr>';
if (!actions_array){
return empty;
}
if (!$.isArray(actions_array))
{
var tmp_array = new Array();
@@ -1861,6 +1869,10 @@ function fromJSONtoActionsTable(actions_array){
actions_array = tmp_array;
}
if (!actions_array.length){
return empty;
}
$.each(actions_array, function(index, scheduling_action){
str += fromJSONtoActionRow(scheduling_action);
});