Search code examples
jqueryasp.net-mvcjquery-uilistselectable

JQuery UI Selectable API add on click not deselect


Im currently implementing a selectable list based off the jquery selectable grid demo at http://jqueryui.com/demos/selectable/#display-grid

My question is, is there a way to have it so when you click on a new grid panel it selects it and doesnt deselect the current selection (disregard the ctl+mouse click logic). i.e. Panels can only be "de-selected" by clicking on them?

Thanks


Solution

  • This should do the trick:

    $(function() {
        $("#selectable").bind("mousedown", function(e) {
            e.metaKey = true;
        }).selectable();
    });