I have created a custom ribbon button for my list. For some pages I wanted to hide the ribbon button and for some pages I wanted to disabled. I found how to make disabled, I wrote following code to make disabled.
<CommandUIHandler Command="{A9424973-D302-4D7D-98B9-7489B6682780}" CommandAction="~site/SitePages/Test.aspx"
EnabledScript="javascript:
function isEnable(){
if(location.href.indexOf('MyPage/DispForm.aspx') > 0){
return true;
}
return false;
}
isEnable();"/>
My problem is how to hide ribbon button using CommandUIHandler. Anybody has an idea?