8000 GitHub - greediness/table-line-sort.js: A easy plugin for table line sort (一个简单的表格行排序插件)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

greediness/table-line-sort.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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
	})
})

About

A easy plugin for table line sort (一个简单的表格行排序插件)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0