bug 12420: apply hostActionfilter() to a newly created host to display/hide actions.

This commit is contained in:
Jessica Wang 2011-12-14 18:11:24 -08:00
parent d777171e1e
commit 1a1ed8bdf9
1 changed files with 8 additions and 5 deletions

View File

@ -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 = [];