jQueryUI可排序-整列的占位符

时间:2019-02-22 11:12:17

标签: jquery jquery-ui html-table jquery-ui-sortable placeholder

水平拖动列标题时,我需要能够对列进行排序。 到目前为止,一切正常。

$( ".tablex thead tr" ).sortable({
    containment: "parent",
    placeholder: "placeholder",
    helper: 'clone',
    axis: 'x',
    appendTo: '.tablex thead',
    start: function(e, ui) {ui.helper.hide();}
});

唯一的问题是,拖动TH时只能看到表头的占位符移动。我希望能够看到整个列作为占位符(或同步的多个占位符)移动。

因此,基本上拖放事件中,我希望看到TH和相关TD的移动,而不是仅抓住TH的移动。

有什么解决方法可以让我做到这一点?

我尝试使用这个:

$( ".tablex thead tr" ).sortable({
    containment: ".tablex",
    placeholder: "placeholder",
    helper: 'clone',
    appendTo: '.tablex',
    start: function(e, ui) {
        ui.helper.hide();
        ui.placeholder.html('...recreate the column from scratch in html...');
    }
});

但是随后我得到了一个仅限TH的移动表列。没有办法让它显示在表头之外。

任何帮助将不胜感激

0 个答案:

没有答案
相关问题