Selection row disable/reenable text selection
<p>I have this code which selects multiple row when shift key is pressed. But whenever selection starts, the table text always gets selected, hence I tried to add disableSelection( ); to the table and re-enable it once mouseup. However, it is not working, the text still get selected. Any help is greatly appreciated.</p>

<pre><code>$(".tableGrid tr").live("click", function(event) {
    if( event.shiftKey ) {
        $(".tableGrid").disableSelection( );
    }
    var tableRow = $(this).closest("tr").prevAll("tr").length + 1;
    if ($(this).hasClass("rowSelected")) {
        event.shiftKey ? $(this).removeClass("rowSelected") : $(".tableGrid tr").removeClass("rowSelected");
    }
    else {
        if( !event.shiftKey ) {
            $(".tableGrid tr").removeClass("rowSelected");
        }
        $(this).addClass("rowSelected");
    }

    if( event.shiftKey ) {
        var start = Math.min(tableRow, lastSelected);
        var end = Math.max(tableRow, lastSelected);
        for( var i=start; i&lt;end; i++ ) { $(".tableGrid").find("tr").eq(i).addClass("rowSelected"); }
    }
    else {
        lastSelected = $(this).closest("tr").prevAll("tr").length + 1;
    }
}).mouseup(function( ) {
    $(".tableGrid").enableSelection( );
});
</code></pre>
