jQuery selectable with a single element deselected by clicking
Posted
by BerggreenDK
on Stack Overflow
See other posts from Stack Overflow
or by BerggreenDK
Published on 2010-05-31T23:51:06Z
Indexed on
2010/05/31
23:53 UTC
Read the original article
Hit count: 199
jquery-ui
|jquery-selectable
I would like to be able to deselect a selected item by clicking or using lasso, just like in Photoshop where I keep another key down to "deselect" parts of an existing selection.
Is this possible?
As I understand "jQuery UI selectable". There is only "single click" with or without CTRL to add multiple and then the quick lasso.
I am trying to see how it would be possible to deselect, one or two elements of a whole selection by clicking them off again.
Eg, you drag the lasso and get 30 elements but finds that 1 does not need to be part of this selection. You click it and deselects it.
So something that reacts to the existing selection and removes the choosen element.
Or with the lasso, you make a lasso selection. Gets 30 elements. Then you draw a new lasso, this time starting on an already selected element, now it default deselects and so does the rest of the group marked.
I believe this should be customizable behaviour for the jQueryUI if anything.
But is the "single deselect" possible with a simple jQuery hack or will it demand a lot of code?
© Stack Overflow or respective owner