A easy plugin for table line s
table-line-sort.js
A jQuery based easy plugin for table line sort (一个基于jQuery的简单的表格行排序插件)
var sortplugin = new tableSort();
pass a <table>
selector in the create method. Set class='sort'
targ in each line.
在 create 方法里传入<table>
的选择器。每行需要一个class = 'sort'
的元素
sortplugin.create('#table');
you can get the line number of your last operation before its move (start with 0), and how much lines its moved (if its move up 1 line, return 1, and return -n when its move down).
你可以获取最后操作的一行更改前的行号(第一行为0),以及它移动了多少行(向上移动则得到正数)
sortplugin.onSort(function(id,n){
console.log({
"id":index,
"n":n
})
})
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。