jqTable: A table component that integrates all interactions

Add-ons
2026-07-26 03:56 3 次浏览 • 0 次下载 29.2KB
jqTable: A table component that integrates all interactions

Last Updated: 2018/8/15 4:34:02 PM

Changelog:Fixed a bug in the total calculation feature


Last Updated: 2018/7/3 3:30:45 PM

Changelog:Added support for scrolling lists with the mouse wheel over fixed columns. Compatible with IE8 (some features, including fixed columns, are not supported in IE8).


Last Updated: 2018/4/28 3:12:01 PM

Changelog:Because the awesome library is too large, fonts have been switched from awesome to iconfont. If your existing project uses awesome, you can switch it back yourself by modifying the icon class names in jqTablePlugin.js. See Example 2 for details.


Last Updated: 2018/4/28 10:51:17 AM

Changelog:Optimized compatibility for Safari


Last Updated: 2018/4/16 6:01:20 PM

Changelog:Optimized updateHtml


Last Updated: 2018/4/12 5:56:35 PM

Changelog:Added a feature to preprocess data before sorting. You can configure automatic character matching and replacement with empty strings, or use a custom function for processing. This solves sorting inaccuracies when values contain units, such as amounts formatted as ¥33,999.000. See Example 8 for usage details.


Last Updated: 2018/1/18 8:12:22 PM

Changelog:Added support for fixing multiple columns. Usage:

$('[role="c-table"]').jqTable({
      fixedLeft: 2,
      fixedRight: 2
});

If you need to fix columns that are not in sequential order, modify the table HTML yourself and then call updateHtml.


Last Updated: 2017/11/27 5:04:10 PM

Changelog:Fixed an error in the compressed JS file that prevented expand and collapse functionality from working. The min.js file has been fixed.


jqTable

Features include:

  • Dynamic table data with a method for updating data

  • Fixed table headers with support for multi-level headers

  • Optional fixed columns on the left and right

  • Checkbox selection and batch operations

  • Nested lists with expandable and collapsible sections

  • Fixed or adaptive column widths

  • Sorting

  • Totals displayed in a fixed row at the bottom

  • Minimum width can be configured for automatically adjusted columns

Class Name Reference

Class NameFunction
c-table-borderAdd borders
c-table--noWrapPrevent text wrapping
c-table--stripedZebra-striped table
g-selectAll--mainCheckbox for selecting parent elements
input type="checkbox" class="g-selectAll"Checkbox for selecting all elements
input type="checkbox" class="g-selectAll--input"Checkbox for selecting individual elements
class="g-selectAll--btn" data-tag="select"Checkbox button. Click to retrieve detailed JSON information about selected values in the callback.
g-toggleTable--mainExpand or collapse parent elements
tr.g-toggleTable--title>th i.g-toggleTable--buttonAllOperation header - Toggle all or individual items
tr.g-toggleTable--title>th i.g-toggleTable--buttonOperation header - Toggle individual items
col data-total="true"Calculate total count
col data-sort="true"Enable sorting

Parameter Reference

Parameter NameDefault Value (Optional Values)FunctionType
fixedLeftfalseFixed on the leftboolean
fixedRightfalseFixed on the rightboolean
fixedMinWidth100Minimum widthnumber
totalString'--'Calculate total number of columnsstring
totalTitle'Total'Title for the total countstring

Hidden parameter reference

Parameter NameFunctionType
data-total="true"Enable the total calculation feature for this columnboolean
data-sort="true"Enable sorting for this columnboolean

Usage Example

html:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div class="c-table c-table--noWrap">
<table cellspacing="0" cellpadding="0" border="0" class="" role="c-table">
<colgroup>
<col name="" width="150">
<col name="" width="120">
<col name="" width="120">
<col name="" width="120">
<col name="" width="">
<col name="" width="">
<col name="" width="140">
</colgroup>
<thead>
<tr>
<th class="">
<div class="cell">Date</div>
</th>
<th class="">
<div class="cell">Name</div>
</th>
<th class="">
<div class="cell">Province</div>
</th>
<th class="">
<div class="cell">City/District</div>
</th>
<th class="">
<div class="cell">Address</div>
</th>
<th class="">
<div class="cell">Postal Code</div>
</th>
<th class="">
<div class="cell">Actions</div>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="">
<div class="cell">2016-05-03</div>
</td>
<td class="">
<div class="cell">Wang Xiaohu</div>
</td>
<td class="">
<div class="cell">Shanghai</div>
</td>
<td class="">
<div class="cell">Putuo District</div>
</td>
<td class="">
<div class="cell">Lane 1518, Jinshajiang Road, Putuo District, Shanghai</div>
</td>
<td class="">
<div class="cell">200333</div>
</td>
<td class="">
<div class="cell">
<button type="button" class="c-button">Remove</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>

JS:

1
$('[role="c-table"]').jqTable();

JavaScript Explanation for the Examples

jqTable js

1
2
3
4
5
6
7
// Import separately
js/jqTable.js: Main code, required
js/jqTablePlugins.js: Contains the expand/collapse and checkbox selection code (optional)
// Complete code
js/jqTable.all.js: Main code + expand/collapse and checkbox selection
// Minified code
js/zipJs/

Other JavaScript Files

1
2
js/plugins: External plugins used in the examples
js/json.js: JSON data used in the examples
星河码客

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

关于本站

联系我们

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

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

Powered by Nuxt · Deployed on Cloudflare