Hide Widgets

cancel
Showing results for 
Search instead for 
Did you mean: 
riadhazzouz
Active Member

Hide Widgets

how to hide widget onclick the AlfButton ?

2 Replies
krutik_jayswal
Senior Member II

Re: Hide Widgets

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.

riadhazzouz
Active Member

Re: Hide Widgets

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.