cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Widgets

riadhazzouz
Confirmed Champ
Confirmed Champ

how to hide widget onclick the AlfButton ?

2 REPLIES 2

krutik_jayswal
Elite Collaborator
Elite Collaborator

It depends on which widget you are using, is it alfresco OOB widget or your customized one.Your question is too much wide. You need to add much more information than this.

here's what I did : 

var toggleTopic = "ALF_HIDE_WIDGET";

var hideWidget = {
rules: [
{
topic: 'ALF_HIDE_WIDGET',
attribute: 'hide',
is: [true]
}
]
};

var firstWidget = {
name : "alfresco/menus/AlfMenuItem",
config : {
label : "Message"
}
};

var secondWidget = {
name: "alfresco/buttons/AlfButton",
publishTopic: toggleTopic,
publishPayload: {
hide: true
},

config: {
label:  "Label"
}
};

var finalWidget = {
name : "alfresco/layout/HorizontalWidgets",
config : {
widgetMarginLeft : "5",
widgetMarginRight : "5",
invisibilityConfig: hideWidget,
widgets : [ firstWidget, secondWidget ]
}
};

I want to hide the finalWidget once the button is clicked.

Thanks.