jQuery Multifunctional Table Plugin ParamQuery Grid

Add-ons
2026-07-26 03:30 4 次浏览 • 0 次下载 55.4KB
jQuery Multifunctional Table Plugin ParamQuery Grid

ParamQuery Plugin Features:

  • Sorting

  • Pagination

  • Adjustable data column widths

  • Adjustable table height and width

  • Customizable themes

  • Show or hide columns

  • Freeze any number of columns, just like in Excel

  • Display data in various formats, such as HTML, arrays, XML, and JSON

  • Compatible with various server-side frameworks, such as ASP.NET, MVC3, JSP, JSF, PHP, and more

  • Virtual scrolling and rendering

  • Direct cell editing

  • Consistent appearance and functionality across all major browsers (IE 6+, Firefox, Chrome, Opera, etc.)

Practical Methods:

First, add references to jQuery and jQuery UI in the HTML head:

Then add a reference to ParamQuery Grid:

1
2
3
4
// This CSS file must be included, regardless of whether you use a theme or not
<link rel="stylesheet" href="/Content/pqgrid/pqgrid.min.css" />
// This JS file must be included
<script type="text/javascript" src="/Scripts/pqgrid.min.js" ></script>

Add the following script code:

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
$(function() {
var data = [[1, 'Exxon Mobil', '339,938.0', '36,130.0'], [2, 'Wal-Mart Stores', '315,654.0', '11,231.0'], [3, 'Royal Dutch Shell', '306,731.0', '25,311.0'], [4, 'BP', '267,600.0', '22,341.0'], [5, 'General Motors', '192,604.0', '-10,567.0'], [6, 'Chevron', '189,481.0', '14,099.0'], [7, 'DaimlerChrysler', '186,106.3', '3,536.3'], [8, 'Toyota Motor', '185,805.0', '12,119.6'], [9, 'Ford Motor', '177,210.0', '2,024.0'], [10, 'ConocoPhillips', '166,683.0', '13,529.0'], [11, 'General Electric', '157,153.0', '16,353.0'], [12, 'Total', '152,360.7', '15,250.0'], [13, 'ING Group', '138,235.3', '8,958.9'], [14, 'Citigroup', '131,045.0', '24,589.0'], [15, 'AXA', '129,839.2', '5,186.5'], [16, 'Allianz', '121,406.0', '5,442.4'], [17, 'Volkswagen', '118,376.6', '1,391.7'], [18, 'Fortis', '112,351.4', '4,896.3'], [19, 'Crédit Agricole', '110,764.6', '7,434.3'], [20, 'American Intl. Group', '108,905.0', '10,477.0']];
var obj = {
width: 700,
height: 400,
title: "ParamQuery Grid Example",
resizable: true,
draggable: true
};
obj.colModel = [{
title: "Rank",
width: 100,
dataType: "integer"
},
{
title: "Company",
width: 200,
dataType: "string"
},
{
title: "Revenues ($ millions)",
width: 150,
dataType: "float",
align: "right"
},
{
title: "Profits ($ millions)",
width: 150,
dataType: "float",
align: "right"
}];
obj.dataModel = {
data: data
};
$("#grid_array").pqGrid(obj);
});

Finally, add a div element where you want the table to be displayed:

1
<div id="grid_array"></div>

That's it! Run the code to see the results.


星河码客

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

关于本站

联系我们

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

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

Powered by Nuxt · Deployed on Cloudflare