jQuery Custom Table (Original)

Add-ons
2026-07-26 04:18 4 次浏览 • 0 次下载 6.7KB
jQuery Custom Table (Original)
1
2
3
4
5
6
7
8
9
10
var backupAataArray=[],// Receive API data to avoid sending multiple requests when switching pages
dataTotalNum=0,// Total number of records
tableNum=5,// Number of records displayed per page
filtrateTable=[],// Data displayed in the table each time, limited by the number of records per page;
pageNum=1,// Current page number;
pageFixedNum=6,// Number of pages set during initialization
dataSet=new Set();// Use a collection to store selected data
var roleSelect=[]// Role dropdown data;
var pagesChoose=[1,2,3,5,10,20];// Customizable number of records displayed per page
var setOn=true;

Table Initialization Function S

1
tableInit(jsonData,1,pagesChoose,false);

Table Initialization Function E

* ID of the table to render. Very important. This is the key to rendering multiple tables (I'll encapsulate this into a reusable component next time. I suddenly realized there are many more things to consider.)

* jsonData: Data (Fixed data is used here because AJAX is not used due to local cross-origin issues. In an actual project, adjust this according to the real environment.)

* Number of records displayed per page. Default is 5. Accepted format: number. Set to true to use the default.

* Customizable number of records displayed per page. Default is [5,10,20]. Accepted format: array. Set to true to use the default.

* Whether to enable selection across pages. A Set is used here to avoid duplicate entries, so please use unique identifiers to distinguish records. true = enabled by default; false = disabled.

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare