how to find selected elements with Jquery UI selectable

前端 未结 5 1240
说谎
说谎 2020-12-31 06:09

I am looking for info on the event and ui objects the jQuery selectable events: \"selecting\", and \"start\" take as parameters. I cannot find this in the documentation and

5条回答
  •  失恋的感觉
    2020-12-31 06:44

    You have to use selected and unselected event which are fired for every selected item in group selection.

    var selected = new Array();
    $("#selectable").selectable({
        selected: function(event, ui){            
            selected.push(ui.selected.id);
        },
        unselected: function(event, ui){
            //ui.unselected.id
        }
    });
    

提交回复
热议问题