如何获得jqGrid的选定行单元格值 [英] How to get a jqGrid selected row cells value
问题描述
有谁知道如何得到的jqGrid所选行的单元格值? I M使用MVC与jqGrid的,我想访问选定行的隐藏列的值?
Does anyone know how to get the cells value of the selected row of JQGrid ? i m using mvc with JQGrid, i want to access the value of the hidden column of the selected row ?
推荐答案
首先,你可以得到 ROWID
选定行相对于的 getGridParam
方法和selrow作为参数,然后你可以使用 getCell ,向相应的列得到单元格的值:
First you can get the rowid
of the selected row with respect of getGridParam
method and 'selrow' as the parameter and then you can use getCell to get the cell value from the corresponding column:
var myGrid = $('#list'),
selRowId = myGrid.jqGrid ('getGridParam', 'selrow'),
celValue = myGrid.jqGrid ('getCell', selRowId, 'columnName');
的'COLUMNNAME
应是您在名称使用相同的名称
的属性 colModel
。如果从选定行的许多列需要的值,可以使用 getRowData A>而不是< A HREF =http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3amethods> getCell 。
The 'columnName'
should be the same name which you use in the 'name'
property of the colModel
. If you need values from many column of the selected row you can use getRowData instead of getCell.
这篇关于如何获得jqGrid的选定行单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!