Buttons - How to click/un-click

Buttons - How to click/un-click

jLinuxjLinux Posts: 981Questions: 73Answers: 75
edited December 2015 in Free community support

Im just trying to use the buttons extension, with a collection of buttons, and I was wondering how I could make it so when you click on a button, it performs an action and stays "pressed", then you can un-click it, and it will perform another action, and then display as an un-clicked button. Heres an example with the column visibility plugin

So just 2 questions..

  1. How do I make it so it stays pressed?
  2. How do I tell in the JS if its being clicked or un-clicked? Do I just have to hold the state of the button in memory and reference that every time? (hoping theres a more elegant way)

Heres the JSbin with my code thus far

This question has accepted answers - jump to:

Answers

This discussion has been closed.