0
我在我的應用程序中使用了JQuery DataTables插件。我需要使用鼠標拖動選項在jQuery數據表中選擇多行。這怎麼可能?如何使用鼠標拖動選項在jquery數據表中選擇多行
我在我的應用程序中使用了JQuery DataTables插件。我需要使用鼠標拖動選項在jQuery數據表中選擇多行。這怎麼可能?如何使用鼠標拖動選項在jquery數據表中選擇多行
使用jQuery UI的選擇和類似下面的代碼:
$("#yourTable").selectable(
{
distance: 10,
stop: function()
{
$(this).find("tr").each(
function() {
if ($(this).hasClass('ui-selected'))
$(this).addClass('row-selected');
else
$(this).removeClass('row-selected');
});
}
});
我使用「距離:10」,因爲我發現我的,否則對錶的mousedown處理程序將無法獲得事件 - 這可能不是對你很重要。