【问题标题】:Is there any method to check a single or multiple row in jqgrid and retrieve onl that data from the jqgrid?有什么方法可以检查 jqgrid 中的单行或多行并从 jqgrid 中仅检索该数据?
【发布时间】:2011-10-22 06:11:01
【问题描述】:

我有一个带有一些数据的 jqgrid。我想要一个只有复选框的列,可以选择整行或多行并在单击按钮时显示其内容。是否有任何网格属性可以这样做?另外,当我使用 getRowData 从 jqgrid 检索数据时,我正在获取带有“输入”标签的数据,因为行是可编辑的。有没有办法只检索普通数据?

【问题讨论】:

    标签: jquery asp.net-mvc-3 jqgrid


    【解决方案1】:

    设置网格时,请务必指定

    multiselect: true
    

    这将允许选择多行。在按下按钮时调用的另一个函数中,您可以通过

    检索选定的行
    var rowIDs = $(jqgridTable).jqGrid('getGridParam', 'selarrow');
    

    然后像这样获取每一行的行数据:

    var currentRowData;
    for(var i=0; i<rowIDs.length; i++){
        currentRowData = $(jqgridTable).jqGrid('getRowData', rowIDs[i]);
        alert(currentRowData["columnName"]);
        ...
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-23
      • 2012-04-26
      • 2018-10-26
      • 1970-01-01
      相关资源
      最近更新 更多