I need to select all but the first row (header) in all tables (GridView) on an ASP.NET page, so that I can apply the jQuery UI Sortable plugin to those rows so that they can be drag/dropped. If I do this:
function pageLoad() {
$('table > tbody').sortable().disableSelection();
}
It correctly applies sortable to the rows in the ‘tbody’ element and not the header row in the ‘thead’ element … until after the first postback, when the ‘thead’ element is lost and the header row then becomes draggable.
What is the correct way to do this? Thanks.
Thanks guys for the suggestions.
Ended up posting the same question on the jQuery forum. Answer was to specifiy the items option on the sortable initialize to select all but the first row:
And this works perfectly …