Multi Select - multiple "colors" or selection states

Multi Select - multiple "colors" or selection states

evan123evan123 Posts: 8Questions: 6Answers: 1

I have been using the multi select, which works great
But I would like to a have a "third" state.
Thus the first click select's and is color blue, then the second click changes it to green, and the third click goes back to not selected.

How would I do this ...

thanks
Evan

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954

    I don't believe there is a way to change the behavior of how select works by allowing to consecutive clicks to keep the row selected. One option is to change the select code to meet your needs. Another is to disable the users ability to select the rows, ie, set select to "api". Then create a click event to manage the row selection and color. You can add an additional class to the selected row, selected2 for example. Use select() or deselect() at the appropriate times.

    See this thread for the CSS settings to set the selected row color. I modified it to use .select2 to set the color to green in this example:
    http://live.datatables.net/venagufi/36/edit

    You might need to adjust the code to handle mulit-selection the way you want.

    Kevin

Sign In or Register to comment.