From 1a1ed8bdf9643f09c8cf40b1fbafb07dc51c8628 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 14 Dec 2011 18:11:24 -0800 Subject: [PATCH] bug 12420: apply hostActionfilter() to a newly created host to display/hide actions. --- ui/scripts/system.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 6c2e39a2b73..566bd1f5777 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5738,8 +5738,11 @@ url: createURL("addHost" + array1.join("")), dataType: "json", success: function(json) { - var item = json.addhostresponse.host[0]; - args.response.success({data: item}); + var item = json.addhostresponse.host[0]; + args.response.success({ + actionFilter: hostActionfilter, //Brian, hostActionfilter() is not being applied here. Please fix widget code to apply actionFilter for a newly created host + data: item + }); }, error: function(XMLHttpResponse) { var errorMsg = parseXMLHttpResponse(XMLHttpResponse); @@ -5773,10 +5776,10 @@ args.response.success( {_custom: {jobId: jid, - getUpdatedItem: function(json) { + getUpdatedItem: function(json) { return json.queryasyncjobresultresponse.jobresult.host; }, - getActionFilter: function() { + getActionFilter: function() { return hostActionfilter; } } @@ -7751,7 +7754,7 @@ return allowedActions; } - var hostActionfilter = function(args) { + var hostActionfilter = function(args) { var jsonObj = args.context.item; var allowedActions = [];