How to get selected row values in easygrid

前提是你 提交于 2019-12-08 09:07:06

问题


I create custom button "open" in grails easygrid plugin. I want get some parameters in this button. How I can get values from the selected row?

<grid:grid id='jqgridinitial' name='customerList' jqgrid.caption="'Customer'"
       open="${g.createLink(controller: 'customer', action: 'index', params:[???] }"

回答1:


This is the javascript code to return the selected row:

var row = jQuery("#jqgridinitial_table").jqGrid('getGridParam','selrow');

But, I think what you actually need is a custom jqgrid formatter: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter

You can see an example here: https://github.com/tudor-malene/Easygrid_example/blob/master/grails-app/views/author/_jqgrid.gsp

and here is how it works ( you click on the author name and it links to wikipedia): 199.231.186.169:8080/easygrid/author/list?impl=jqgrid

In your case you should construct the link to the customer based on the actual row data



来源:https://stackoverflow.com/questions/22219944/how-to-get-selected-row-values-in-easygrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!