Drag multiple select

Drag multiple select

underforgeunderforge Posts: 4Questions: 0Answers: 0
edited February 2010 in General
I'd like the user to be able to drag across a number of rows and have them selected. Similar to a select box. Anyone know if this is possible either out of the box or with some creative scripting?

Thanks

Replies

  • underforgeunderforge Posts: 4Questions: 0Answers: 0
    edited February 2010
    I worked it out using jQuery UI:


    [code]
    #myTable .ui-selecting { background: #FECA40; }
    #myTable .ui-selected { background: #FECA40; }
    [/code]
    [code]
    $('#myTable').selectable({
    filter: 'tr',
    stop: function(){
    $(".ui-selected", this).each(function(){
    var index = $("#myTable tr").index(this) - 1;
    $('#myTable tbody tr:eq('+index+')').toggleClass('row_selected');
    $('#myTable tbody tr:eq('+index+')').toggleClass('ui-selected');
    });
    }
    });
    [/code]
This discussion has been closed.