jqGrid笔记-1-概况

jqGrid
http://www.trirand.com/jqgridwiki/doku.php
How to Install
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:how_to_install
Downloading jqGrid
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:download
files needed for using jqGrid are in main /css/ and /js/ directories
使用jqGrid需要的文件主要存在/css/ 和 /js/文件夹中。
Files in /src/ directory are actually the pure source code and can be used from developers to easily find bugs and make improvements.
/src/ 文件夹中的文件只是纯代码,开发人员可以利用它来对代码进行改进和除错。
In order to use the grid plugin you will need to download the desired theme.
为了使用jqGrid你还需要下载jQuery的UI主题(jQuery UI theming).
If you plan to use only the grid component you do not need to have all the CSS files that come from the package. In this case you will need to use only basic theming files ui.theme.css and ui.core.css. These files are located in development-bundle/themes directory in the downloaded UI theme file.
如果你只想使用grid组件,就不需要使用所有的CSS文件。只要使用基本的主题文件就好,它们是ui.theme.css 和 ui.core.css。这些文件放在development-bundle/themes文件夹里。
How it Works
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:how_it_works
A jqGrid is comprised of the following four parts:
一个jqGrid由4部分组成:
    Caption layer 标题栏
    Header layer 表头
    Body layer  表体
    Navigation layer导航栏
My First Grid
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid
传递的xml数据结构:
<?xml version ="1.0" encoding="utf-8"?>
<rows>
  <page> </page>
  <total> </total>
  <records> </records>
    <row id = 'unique_rowid'>
      <cell> cellcontent </cell>
      <cell> <![CDATA[<font color='red'>cell</font> content]]> </cell>
        …
    </row>
    <row id = 'unique_rowid'>
      <cell> cellcontent </cell>
      <cell> <![CDATA[<font color='red'>cell</font> content]]> </cell>
        …
    </row>
      …
</rows>
rows the root tag for the grid
page the number of the requested page显示第几页
total the total pages of the query 查询到的总页数
records the total records from the query 查询到的总记录数
row a particular row in the grid 一个特定的行
cell the actual data. Note that CDATA can be used. This way we can add images, links and check boxes. 实际要显示的数据。
The number of cell tags in each row must equal the number of cells defined in the colModel. In our example.
每个row中的cell的数量必须与表格的列数相同也就是colModel中定义的列的个数。
Note the id attribute in the <row> tags. While this attribute can be omitted, it is a good practice to have a unique id for every row. If this attribute is omitted, jqGrid has two ways of dealing with need for unique ids: if the property key in the colModel is set to true for a particular column, then jqGrid will assign the value of this column to be the id of the row; otherwise, jqGrid sets the row id based on the order of the row.
注意row标签中的id属性。这个属性可以省略。但最好有一个唯一的量来标识一行。如果省略了id属性,jqGrid有2种方法来处理唯一标识的需求:如果colModel中定义了key属性为true的列,则jqGrid将把所属这个列的值作为这行的id值;否则,jqGrid把行的顺序号赋给id.
If you are using a content-free primary key to identify your data rows, then do not include this value in the grid as a visible cell; instead, include it in the query and pass it as the row id attribute. It will always be available for jqGrid and even jQuery operations but not be visible on the page.
如果您使用无意义的字段做为数据行的主键,最好不要在grid中显示它。而要在查询中包含它,并且把它作为行的id属性传递给grid。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值