主网格中的JQGrid按钮每行加载详细信息网格 [英] JQGrid button in Master grid each row to load Detail grid

查看:82
本文介绍了主网格中的JQGrid按钮每行加载详细信息网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以下网址测试示例: http://trirand.com/blog/jqgrid/jqgrid.html .现在,Detail Grid正在页面加载时以默认ID加载.

I am testing example at this url : http://trirand.com/blog/jqgrid/jqgrid.html . Right now Detail Grid is loading with default id at the page load.

请求的功能:

我希望单击每一行中的详细信息"按钮都应加载详细信息网格".有人告诉我怎么做.我也在为此而苦苦挣扎.

I want Detail button in each row when clicked should load the Detail Grid. Anyone please tell me how. I am also struggling with that.

推荐答案

您可以使用<botton type='button' ....>(或<input type='button' ...>). com/jqgridwiki/doku.php?id = wiki:events"rel =" nofollow noreferrer>事件处理程序.如果您查看 jqGrid演示,然后选择行编辑"/,则可以找到一个示例. 自定义编辑".您可以像在行编辑"/自定义编辑"示例中一样或在onClick事件绑定>不干扰的方式(请参见此处不完全相同的示例,但希望您能理解我的意思)使用 jQuery.click

You can use custom formatter or instert the <botton type='button' ....> (or <input type='button' ...>) with respect of 'setRowData' inside of loadComplete or gridComplete event handler. You can find an example if you look at jqGrid demo and choose "Row Editing" / "Custom Edit". The binding of onClick event you can do either as in "Row Editing" / "Custom Edit" example or in unobtrusive way (see an example from here not exactly for the same problem, but I hope you will understand what I mean) using jQuery.click or jQuery.bind. By the way instead of the button you can consider to use link (<a> or showLink).

在点击"手柄内,您可以像在onSelectRow内那样典型地强制加载详细信息网格.

Inside of "click" handle you can force loading of the detail grid exactly like you do this typically inside of onSelectRow.

已更新:在此处看看如何将静态文本作为链接放置在jqGrid中:

UPDATED: Look here to see how one can place static texts as links in the jqGrid:

可能需要在服务器响应的JSON的详细信息"列中填充空字符串".在某些情况下,取决于数据格式,并且可能不需要使用jsonReader.

It could be needed to fill empty string '' in the "Details" column in the JSON respond from the server. In some cases depends from the data format and the jsonReader used it could be not required.

在主/详细方案的情况下,您可以在演示示例中显示单击行..."文本的地方显示(设置url或postData并触发gridReload)详细信息网格.

In case of master/detail scenario you can display (set url or postData and trigger gridReload) detail grid on the place where "clicked the row ..." texts are displayed in the demo example.

这篇关于主网格中的JQGrid按钮每行加载详细信息网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆