FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Jan 13, 2012, 5:35 AM
170 Posts

Change css class on clicked component

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1
 If I have a serverside onclick event how do I change the css class on the object I clicked?
 
I have tried using this but then all my repeaated images gets this class.  
Jan 15, 2012, 10:43 PM
25 Posts
Re: Change css class on clicked component
 In the client side javascript for the onclick event, take a look at the dojo.replaceClass method. This will replace a classname with another classname. It works really well. However, if you're not on 8.5.3 try dojo.addClass and dojo.removeClass. Once you're done with the class manipulation return true for the client side javascript and then the ssjs will run.
 
HTH 
Keith 

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.