I am using jQuery UI Sortable for reordering the rows. I have 10 (td) columns out of which I show only 6 and remaining 4 are not shown using display:none.
The issues I am facing are
In Chrome while dragging all other rows (not the dragged one) columns shrink and then after dropping the row they get expanded to normal size. Why are the rows columns getting shrink while dragging?
In IE8 same as above but after dropping the row they are still in the shrink mode and not expanded to normal size.
Please find the code below. My issue is the other rows width is getting shrink and not the draggable row.
this.$('.reportTableBody').sortable({
tolerance:"pointer",
//TODO need to fix
cursor: 'move',
revert: 'true',
helper: function(e, tr)
{
var myHelper = [];
myHelper.push('<table style="width: 100%">');
myHelper.push($(tr).html());
myHelper.push('</table>');
return myHelper.join('');
},
create: function (event, ui) {
$("td").each(function () {
$(this).css("width", $(this).width());
});
if (jQuery.browser.msie && Number(jQuery.browser.version) == 8) {
this.$('.reportTableBody').sortable("option", "cursorAt", { top: 100 });
}
},
stop : function(event, ui){
$(ui.item.parent()).find('tr').each(function(index){
$(this).find('.yearSelectCell:first').html(index + 1);
});
ui.item.trigger('drop', ui.item.index());
}});
FYI - some of the columns have display:none which would hide the columns. Do you think because of this the column widths are shrinking ?