Home Analyst Portal

Hide Hardware Asset tasks

Peter_MuttenthalerPeter_Muttenthaler Partner Advanced IT Monkey ✭✭✭

Dear all,

after updating cireson to 9.4.5 we aren't able anymore to hide the Hardware Asset tasks by using:

$(document).ready(function () {

if (window.location.href.indexOf("AssetManagement/HardwareAsset/Edit") === -1)

{return;}


var mainPageNode = document.getElementById('main_wrapper');

var observer = new MutationObserver(function(mutations) {

//The page changed.

var titleElement = $(".page_title");

// check page title actually exists

if (titleElement.length > 0) { 

//var csli = $("li:contains('Change Status')");

//$(csli).hide();

  $( ".taskmenu li:contains('Associate Cost Center')" ).hide(); 

$( ".taskmenu li:contains('Associate Custodian')" ).hide(); 

//done with observer

observer.disconnect();

}

});

var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };

observer.observe(mainPageNode, observerConfig);

});

Does anybody have a working solution?


PS: The following solution is just working for work items :(

app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {

 formObj.boundReady(function(){

 var vm = pageForm.viewModel;  

  $( ".taskmenu li:contains('Remove Me From WatchList')" ).hide(); 

  $( ".taskmenu li:contains('Add Me To WatchList')" ).hide();

 });

 return;

});


Thanks in advance!

Best regards

Best Answer

Answers

  • Peter_MuttenthalerPeter_Muttenthaler Partner Advanced IT Monkey ✭✭✭

    Hi Steve,

    thank you for your fast and great reply! It did it for me ;)

Sign In or Register to comment.