简体   繁体   English

jqgrid当前行已选择

[英]jqgrid current row selected

i am using this method me return last selected row and i want current selected row. 我正在使用此方法,我返回最后选择的行,我想要当前选择的行。

//JavaScript // JavaScript

$.subscribe('cellselect', function(event, data) {   
var sel_id = jQuery("#gridtable").jqGrid('getGridParam', 'selrow');      
alert(sel_id); 
});

//JQgrid event // JQgrid事件

onCellSelectTopics="cellselect"

In the Documentation says: "selrow: string This option is readonly. It contains the id of the last selected row". 在文档中说:“ selrow:字符串此选项是只读的。它包含最后选择的行的ID”。 here 这里

The selrow option will retrieve the currently selected row in the grid. selrow选项检索网格中当前选定的行。 Are you running into trouble when using this option in your application code? 在应用程序代码中使用此选项时是否遇到麻烦?

For what it's worth, if you did want to get the ID of the previously selected row then you would have to add additional code to your application. 对于它的价值,如果您确实想获取先前选择的行的ID,则必须向应用程序中添加其他代码。

selrow will return the currently selected row index if you are not using paging. 如果不使用分页,则selrow将返回当前选定的行索引。 If paging is used it will return null. 如果使用分页,它将返回null。

See this link for more information. 有关更多信息,请参见此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM