从jqGrid检索选定的行 [英] Retrieving selected rows from jqGrid
问题描述
我的jqGrid 3.5(完整版)可以正常工作.我在启用多选选项的情况下检索数据.我无法工作的一部分是获取选定的行. 文档状态:
I have jqGrid 3.5 (full) mostly working. I have it retrieving data with the multi-select option on. The one part I can not get to work is getting the selected rows. The docs state:
要获取选定的行,我们可以使用getGridParam('selarrrow')方法.使用我们的示例,我们可以这样写:
To obtain selected rows we can use getGridParam('selarrrow') method. Using our example we can write this:
jQuery(#grid_id").getGridParam('selarrrow');
jQuery("#grid_id").getGridParam('selarrrow');
,它将返回具有选定行的数组(即,上图中的["11","9"]).数组中的值是所选行的ID.
which will return an array with the selected rows (i.e., ["11","9"] from the figure above). The values in array are the id's of the selected rows.
这不起作用,并返回一个未定义的值(是的,我选择了行).我的网格配置中也有xmlreader:id设置.
This does not work and returns an undefined value (yes I have rows selected). I also have xmlreader:id setup in my grid config.
有人可以指出我要寻找的方向吗?我尝试了所有我能想到的一切.
Can someone point me to a direction to look? I have tried everything I can think of to no avail.
更新:关于错误的选择器,红场是正确的.我所包含的div与网格具有相同的ID,当我去检查设置代码时,我注意到了这一点,选择器被table#results
更改,并且一切正常.谢谢大家如果您发布的答案是红色方块,我会接受它,因为它是正确的答案.
UPDATE: redsquare was correct about incorrect selectors. my containing div had the same ID as the grid, I noticed this when I went to check my setup code and the selector was table#results
changed that and it all works. Thanks all. If you post an answer redsquare I will accept it as it is the correct answer.
推荐答案
能否先为我检查选择器.如果它们是正确的,您是否可以尝试在jsbin.com上上传页面或复制问题. :)
Can you check the selectors for me first. if they are correct can you try to upload your page or replicate the issue at jsbin.com. :)
这篇关于从jqGrid检索选定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!