Question

How to hide the action items in case section?

Hello,

 

Can someone provide me with the code to edit the "cancel case" and "close case" action items in case section (Please see the screenshot attached). I need to hide these items based on the values of a specific field.

 

 

Here is the code I used but it doesn't work.

 

getActions: function() {
				var numberOfGuests =  this.get("UsrHousingGuest");
				if(numberOfGuests <= 50 ){
				var actionMenuItems = this.Ext.create("Terrasoft.BaseViewModelCollection");
				actionMenuItems.addItem(this.getButtonMenuItem({
					"Caption": {"bindTo": "Resources.Strings.CancelCaseActionCaption"},
					"Tag": "cancelCase",
					"Enabled": false
				}));
		}
}

Many thanks in advance,

Mouna.

Like 0

Like

1 comments

Hello,

 

For example you can use this method in the replaced PortalCasePage:

getActions: function() {
						var actionMenuItems = this.callParent(arguments);					
						actionMenuItems.addItem(this.getButtonMenuItem({
							"Caption": {"bindTo": "Resources.Strings.CancelCaseActionCaption"},
							"Tag": "cancelCase",
							"Enabled": {"bindTo": "EnableCancelAction"},
							"Visible": false
						}));
						actionMenuItems.addItem(this.getButtonMenuItem({
							"Caption": {"bindTo": "Resources.Strings.CloseCaseActionCaption"},
							"Tag": "closeCase",
							"Enabled": {"bindTo": "EnableCancelAction"},
							"Visible": false
						}));
						actionMenuItems.addItem(this.getButtonMenuItem({
							"Caption": {"bindTo": "Resources.Strings.ReopenCaseActionCaption"},
							"Tag": "reopenCase",
							"Enabled": {"bindTo": "EnableReopenAction"},
							"Visible": false
						}));
						return actionMenuItems;
					},

the "Visible": false property will make the buttons invisible.

 

Best regards,

Oscar

Show all comments