jeecg中移动tbody中的tr可实现位置交换

<tbody id="add_decLists_table"> 

<tr>
<td align="center"><div style="width: 25px;" name="xh">${stuts.index+1 }</div></td>
<td align="center"><input style="width: 20px;" type="checkbox"
name="ck" /></td>

</tr>

</tbody>

1.引入js

<t:base type="jquery,easyui,tools,DatePicker,jqueryui-sortable"></t:base>

2.css样式修改:

#add_decLists_table tr {
border-bottom: 1px solid #e6e6e6;
cursor: n-resize;
}

3.给add_decLists_table赋属性

setTimeout(function(){
$("#add_decLists_table").sortable({
helper: fixHelper,
items: '> tr',
forcePlaceholderSize: true,
stop: function (event, ui) {
resetTrNum('add_decLists_table');
}
}); 
}, 2000);

 

posted @ 2021-12-16 11:10  许佳挺  阅读(68)  评论(0编辑  收藏  举报