【发布时间】:2014-05-17 04:19:02
【问题描述】:
请您帮忙解决这个问题。在这里找到小提琴代码:
jsfiddle.net/srikanthsvr82/mZc7V/4
发生的情况是,当我拖动一行时,拖动的行是全宽的,看起来不错,但其他行缩小/列宽减小。正如您在注释代码中看到的那样,我一直在尝试所有选项,但没有一个有效:
/*
start: function(event, ui){
ui.placeholder.width(ui.item.width()).height(ui.item.height());
},
helper: function(e, tr){
tr.children().each(function() {
$(this).width($(this).width());
});
return tr;
$("td").each(function () {
$(this).css("width", $(this).width());
});
var $originals = tr.children();
var $helper = tr.clone();
$(tr.parent()).find('tr').each(function(index){
$('td', this).each(function(index){
$(this).css('width', $helper.eq(index).width());
});
});
$helper.children().each(function(index){
//Set helper cell sizes to match the original sizes
$(this).width($originals.eq(index).width());
});
return $helper;
}
*/
任何人都可以提出解决方案。
【问题讨论】:
标签: jquery user-interface jquery-ui-sortable