zoukankan      html  css  js  c++  java
  • jqgrid使用小记

    记录jqgrid使用种碰到的一些问题,某些不常用问题时间久了会忘。

    Jqgrid 如何读取自定义格式的json内容(比如带分页信息的,page、number等)

    比如,服务器端的Controller,返回JSON体的属性名不一定相同,有的总页数叫做totalPages,有的叫做totals等,那么jqgrid的js端要如何识别这些呢,直接在jqgrid的默认加载函数种,配置如下信息就行,具体参数见代码种注释。

    jsonReader: {
        root: "content", // json中代表实际模型数据的入口
        page: "number", // json中代表当前页码的数据
        total: "totalPages", // json中代表页码总数的数据
        records: "totalElements" // json中代表数据行总数的数据
        // subgrid: {root: "data"}
    }

     Jqgrid 界面不显示表格 

    直接查看web控制台,找原因即可,有次竟然忘记了,死活去调试JS,浪费了半天时间。

    返回200,但是jqgrid表格中不显示数据

    查看 jsonReader种的root内容,是否与返回json信息的名称一致。

        jsonReader: {
                    root: "content", // json中代表实际模型数据的入口
                    page: "number+1", // json中代表当前页码的数据
                    total: "totalPages", // json中代表页码总数的数据
                    records: "totalElements", // json中代表数据行总数的数据
                    // subgrid: {root: "data"}
                },
    

    jqgrid显示行号:

    rownumbers:true

     

  • 相关阅读:
    上机练习
    myeclipse 快捷键
    关于java classpath问题
    windows installer 出错问题解决
    hibernate 问题
    axis2 部署webservice
    webservice开发
    关于web前端开发
    软件工程工具
    计网笔记
  • 原文地址:https://www.cnblogs.com/falcon-fei/p/9732838.html
Copyright © 2011-2022 走看看