本文介绍了如何获取easygrid中的选定行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在grails easygrid插件中创建自定义按钮open。我想在这个按钮中获得一些参数。如何从选定的行获取值?

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

解决方案

这是返回所选行的javascript代码:

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

但是,我认为您实际需要的是自定义jqgrid格式器:



你可以在这里看到一个例子:



以下是它的工作原理(您点击作者名称并链接到wikipedia):
199.231.186.169:8080/easygrid/author/list?impl=jqgrid



在您的情况下,您应该根据实际行构建到客户的链接数据

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:[???] }"
解决方案

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

这篇关于如何获取easygrid中的选定行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 13:55