Any suggestions? I thought this would be an easy question for the skuid team? I’ve been looking around in the DOM/Object but there are multiple refrences to the icons and I can’t figure out the right way to to this.
Hi Peter,
Here’s a sample snippet that will toggle the icon of a Mobile Button back/forth between two icons, where iconA is the initial icon you set through the Mobile Composer, and iconB is a different icon. Basically you can just use buttonIcon.removeClass(ICON_NAME) to get rid of the current icon and buttonIcon.addClass(ICON_NAME) to change to a different icon.
var params = argumentst0], <br> $ = skuid.$;<br>var iconA = "fa-circle";<br>var iconB = "fa-circle-o";<br>var btn = params.component.button;<br>var buttonIcon = btn.icon;<br>var buttonText = btn.text;<br>buttonIcon.toggleClass(iconA).toggleClass(iconB);<br>buttonIcon.html('new text goes here');
thanks Zach , works perfect. the last line should be
buttonText.html('new text goes here');