how to find selected elements with Jquery UI selectable

前端 未结 5 1244
说谎
说谎 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 07:01

    When an element is selected it gets the ui-selected class added.

    So you could get all selected elements with $(".ui-selected")

    This might not work exactly but I think the idea would be something like this:

    $('#content_td_account').selectable({
      filter: 'li:not(".non_draggable")',
      selecting: function(event, ui) { 
        var p = $(this).parent();
        $(".ui-selected").each(obj, function() {
          if(obj.parent() == p) {
            // get rad
          }
        });
      }
    });
    

提交回复
热议问题