zoukankan      html  css  js  c++  java
  • jqGrid专题:jqGrid原理

    jqGrid 是B/S架构,服务器端管理数据,客户端显示出来,jqGrid采用ajax来处理请求与响应。

    jqGrid 是基于jQuery的一个表格控件。源码开放:jquery.jqGrid.src.js,有兴趣的大虾可以看看写法。

    需要使用jqGrid时,引入以下文件即可:

    js: jquery.js  jquery.jqGrid.min.js

    css: ui.jqgrid.css

    theme:主题可根据需要自定义,jquery-ui 的主题都是支持的

    下面是摘自jqGrid Wiki 文档中关于jqGrid如何工作的部分:

    Understanding how jqGrid works will help you get up to speed with the full capabilities of the plugin. The first thing to understand is that there are two aspects to working with tabular data:

    • Client-side representation, and
    • Server-side manipulation

    JqGrid is a component that presents tabular data for easy manipulation in a web browser grid. jqGrid uses Ajax calls to retrieve information and construct the representation (tabular data) using the jqGrid Column Model (colModel).

    Furthermore, jqGrid helps you send any data changes or additions to the database on the server-side, a process known as server-side manipulation, or SSM.

    SSM means the server handles the actual changes to the database, and not the user's browser. SSM isn’t something that is visible within a web page. Server side data changes are done using PHP, or any other common programming language.

    A jqGrid is comprised of the following four parts:

    • Caption layer
    • Header layer
    • Body layer
    • Navigation layer

    Caption layer contains common information for the represented data.

    Header layer contains information about the columns: labels, width, etc.

    Body layer is the data requested from the server and displayed according to the settings in the column model.

    Navigation layer contains additional information from the requested data and actions for requesting little pieces of information – in the literature called paging. Note that the navigation layer can be placed not only at bottom of the grid, but anywhere on the page. The Navigation layer is also the place for adding buttons or links for editing, deleting, adding to and searching your grid data.

    The minimum for the representing the data are Header layer and Body layer.

    To allow freedom and flexibility, and often a better impression, jqGrid relies on CSS (Cascading Style Sheets) to govern its appearance.

    In more sophisticated case the grid can have more elements as shown below:

    The grid can not only have additional layers, but also allow more than the rows to contain the main data. jqGrid support treegrid, subgrid and grouping of data.

    If you choose, the grid can look like a table having some advance features like sorting, resizing of columns, reordering of columns with respect of drag&drop and so on, as shown below:

    幸福是奋斗出来的
  • 相关阅读:
    Spring Boot 配置元数据指南
    面试中常被提到的最左前缀匹配原则
    MyBatis缓存机制(一级缓存,二级缓存)
    计算机网络基础知识
    垃圾收集算法与垃圾收集器
    递归与分治策略
    五种IO模型和BIO,NIO,AIO
    七种阻塞队列
    ConcurrentHashMap(1.7版本和1.8版本)
    重入锁 ReentrantLock
  • 原文地址:https://www.cnblogs.com/ydchw/p/3022260.html
Copyright © 2011-2022 走看看