Feb 28, 2022, 11:37 AM
Can i change IconCls for a button based on a condition?
Hello, im tyring to change an icon for a button based on a condition
and my JS code:
Any help would be appreciated as my JS code does not work
<ext:Button ID="NotifLogo" runat="server" Text="Notification">
<Listeners>
<Click Handler="#{NotificationsWindow}.show(); ReloadMe(); " />
</Listeners>
</ext:Button>
and my JS code:
<script type="text/javascript">
if (1 != 2) {
if (1 < 2) {
Ext.Net.ResourceManager.RegisterIcon(["BellStop"]); //if an icon has not been registered yet
NotifLogo.setIconClass("icon-bellstop");
} else {
Ext.Net.ResourceManager.RegisterIcon(["Bell"]); //if an icon has not been registered yet
NotifLogo.setIconClass("icon-bell");
}
}
Any help would be appreciated as my JS code does not work