zoukankan      html  css  js  c++  java
  • jQuery学习笔记--JqGrid相关操作 方法列表(上)

    1.获得当前列表行数:$("#gridid").getGridParam("reccount");

    2.获取选中行数据(json):$("#gridid").jqGrid('getRowData', id);

    3.刷新列表:$(refreshSelector).jqGrid('setGridParam', { url: ''), postData: ''}).trigger('reloadGrid');

    4.选中行:$("#jqGrid").setSelection("1", true);  (Toggles a selection of the row with id =rowid; ifonselectrowis true (the default) then the event onSelectRow is launched, otherwise it is not.)//true:重新加载表格数据, false:不重新加载表格数据

    5.重置选中行:$("#jqgrid").resetSelection(); //Resets (unselects) the selected row(s). Also works in multiselect mode.

    6.清除:$("#jqgrid").clearGridData();  //Clears the currently loaded data from grid. If the clearfooter parameter is set to true, the method clears the data placed on the footer row.

    7.$("#jqgrid").setCell(rowid,colname,nData,cssp,attrp);

    //This method can change the content of particular cell and can set class or style properties. Where:

    rowidthe id of the row, 
    colnamethe name of the column (this parameter can be a number (the index of the column) beginning from 0
    datathe content that can be put into the cell. If empty string the content will not be changed
    classif class is string then we add a class to the cell using addClass; if class is an array we set the new css properties via css
    propertiessets the attribute properies of the cell,

    forceupIf the parameter is set to true we perform update of the cell instead that the value is empty

    8.获取选中行ID

    var rowid = $("#jqgrid").jqGrid('getGridParam','selrow');

    var rowid = $("#searchResultList").getGridParam("selrow");
    var rowData = $("#searchResultList").getRowData(rowid); /根据行ID,获取选中行的数据(根据)

  • 相关阅读:
    TCP Socket服务器编程[转文]
    http协议学习和总结系列[转 ]
    linux C函数大全
    HTTP 协议详解
    Pthread 多线程总结
    linux 中解析命令行参数 (getopt_long用法)
    微软企业库4.1学习笔记(十八)缓存模块6 缓存的设计目的
    微软企业库4.1学习笔记(十七)缓存模块5 缓存的典型用法
    进程和线程的区别
    C#二叉树遍历算法实现浅析
  • 原文地址:https://www.cnblogs.com/eyunhua/p/3807338.html
Copyright © 2011-2022 走看看