jqGrid 使用单选按钮来编辑可编辑行

发布于 2024-09-10 07:59:58 字数 329 浏览 0 评论 0原文

我目前正在使用 jqGrid 和 ASP.Net MVC。在我当前的项目中,我的目标是向最终用户提供数据网格,然后他们可以对其进行编辑。数据是机器生成的,用户会确认机器是否正确。

我认为为了速度理想,我想为每个项目提供一行,并使用单选按钮组作为可编辑项。然后,用户可以从值“未知”、“正确”、“不正确”中进行选择。

由于会有大量数据,我还想提供某种类型的控件,可以将网格中的所有行设置为可用单选按钮选项之一,以提高用户体验。

鉴于 jqGrid 中似乎没有对此进行本机支持,我想问是否有人有编写类似内容的经验,以及这是否可实现且可靠,或者我是否应该坚持使用下拉可编辑方法是 jqGrid 原生的。

I'm currently using jqGrid and ASP.Net MVC. With my current project, my goal is to provide a grid of data to the end user, and they can then edit this. The data is machine-generated, and the users will be confirming if the machine is correct or not.

I think ideally for speed, I'd like to provide a row per item, with a radio button group as the editable. The users could then pick from the values 'Unknown', 'Correct', 'Incorrect'.

As there will be a lot of data, I'd also like to provide a control of some type that can set all rows in the grid to one of the available radio button choices, for the user experience.

Given that there seems to be no native support for this in jqGrid, I wanted to ask if anyone has had any experience writing something like this, and whether this is achievable and reliable, or whether I should stick with the drop-down editable approach that is native to jqGrid.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南汐寒笙箫 2024-09-17 07:59:58

要将单选按钮实现为可编辑而不是标准的下拉可编辑方法,您可以使用 jqGrid 的所谓自定义编辑功能(请参阅 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#custom)。这允许您创建任何自定义控件来编辑单元格值。您可以在此处找到实现示例:在自定义编辑类型字段中添加多个输入元素

要将网格中的所有行设置为可用单选按钮选项之一,您可以使用 jqGrid 外部的控件或在导航栏中添加其他自定义按钮(请参阅 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_buttons)。如果您搜索 navButtonAdd 您会发现很多如何实现此功能的示例,例如 Jqgrid:基于所选行的导航。因为您使用基于服务器的数据,所以您只需调用服务器上的方法来进行所需的更改,然后调用 trigger("reloadGrid") 刷新 jqGrid 数据。

To implement radio button as the editable instead of the standard drop-down editable approach you can use so named custom editing feature of jqGrid (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#custom). This allows you to create any custom control to edit the cell value. An example of the implementation you can find here: Add multiple input elements in a custom edit type field.

To set all rows in the grid to one of the available radio button choices you can use either a control outside of jqGrid or add an additional custom button in the navigation bar (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_buttons). If you search for navButtonAdd you will find a lot of examples how to implement this, for example, Jqgrid: navigation based on the selected row. Because you use server based data, you can just call a method on the server to make the changes which you need and then call trigger("reloadGrid") to refresh jqGrid data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文