jQuery表格插件ParamQuery简单使用方法示例

实现步骤:
先在html的head中加入对jQuery和jQuery UI的引用:

复制代码 代码如下:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/themes/base/jquery-ui.css" />
<script src="/UploadFiles/2021-04-02/jquery.min.js"><script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js">


再加入对Param Query Grid的引用:
复制代码 代码如下:
<link rel="stylesheet" href="/Content/pqgrid/pqgrid.min.css" />           <!--这个css文件必须引用,无论你是用了皮肤,还是没有用到皮肤,都要引用-->
<script type="text/javascript" src="/UploadFiles/2021-04-02/pqgrid.min.js">

增加脚本代码:
复制代码 代码如下:
$(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 = {};
                obj.width = 700;
                obj.height = 400;
                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);

            });

最后,在要显示的地方加入div元素,用来显示表格:

复制代码 代码如下:
<div id="grid_array"></div>

运行就能看到效果

加入Theme皮肤的Demo

jQuery表格插件ParamQuery简单使用方法示例

实现步骤:
js代码逻辑部分没有任何变动,哈哈。
html的head部分增加那么一句style引用,就搞定了,如下:

复制代码 代码如下:
<link rel="stylesheet" href="/Content/pqgrid/pqgrid.min.css" />               <!- 这句就是增加的,其他没有任何变动...哈哈 ->
<link rel="stylesheet" href="/Content/pqgrid/themes/peach/pq-grid.css" />
<script type="text/javascript" src="/UploadFiles/2021-04-02/pqgrid.min.js">

华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。

更新日志