在jqGrid中,您可以一次内联编辑多个行,然后执行一次提交吗? [英] In jqGrid, can you inline edit multiple rows at once and then do a single commit?

查看:109
本文介绍了在jqGrid中,您可以一次内联编辑多个行,然后执行一次提交吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用jqGrid的jQuery('#grid').editRow()功能,该功能使您可以内联编辑行中的字段.

We are using the jQuery('#grid').editRow() feature of jqGrid, that allows you to edit fields in a row inline.

jqGrid是否支持一次对多行的内联编辑,我可以在其中对多行进行更改,然后一次提交所有内容?

Does jqGrid support inline editing of multiple rows at once, where I can make changes on multiple rows and then submit all at once?

我们试图避免必须对每一行进行一次更改,并每次都对服务器进行一次单独的往返"提交,因为在这种情况下,我们想批量编辑多个字段记录并有一个提交".

We are trying to avoid having to make changes to each row one by one and do a separate "round trip" to the server to commit each time, for cases were we want to bulk edit a number of fields for a number of records and have a single "commit".

推荐答案

jqGrid不能实现多行的内联编辑.您可以使用本地编辑并将所有更改手动发布到服务器,但是您必须自己实现所有更改的提交.

Inline editing of multiple rows is not implemented by jqGrid. You can use local editing and post all the changes to the server manually, but you will have to implement the submit of all changes yourself.

我个人不会在我的项目中实现这种行为.原因是我认为该网站应该始终支持并发(最乐观的并发意义).如果有人尝试将更改提交给服务器,则服务器可以回答并发错误:其他人已经修改了数据.在这种情况下,应刷新网格数据,并应重复行的编辑.在使用乐观并发的情况下,我发现实现多行编辑的问题.错误消息将如何显示?如果更改了许多行,错误消息应该是什么样?如果出现错误,用户应该怎么办?他/她是否应该重复数据的全部更改?从用户的角度来看,好处在哪里?

I personally would not implement such behavior in my projects. The reason is that I think that the web site should always support concurrency (optimistic concurrency have the most sense). In the case if one person try to submit the changes to the server, the server can answer with the concurrency error: some other person have already modified the data. In the case the grid data should be refreshed and the editing of row should be repeated. I see problems with implementing of editing of multiple rows in case of the usage of optimistic concurrency. How would the error messages look like? If many rows are changed how the error message should look like? What should the user do in case of error? Should he/she repeat the full changing of the data? Where are the benefit from the users point of view?

在我拥有的所有jqGrid实现中,几乎立即提交了一行的编辑.因此,我认为无需在项目中一次执行多行.由于往返"减少带来的好处,在并发错误情况下对用户的不利也更大.由于与服务器之间的连接良好,因此在我的客户环境中发送数据不是问题.

The submitting of the editing of one row was almost immediately in all jqGrid implementations which I had. So I see no need to do multiple rows at once in the projects. Disadvantages for the user in case of concurrency errors are larger as advantages from "round trip" reduction. Because of very good connection to the server the sending of the data is not a problem in environments of my customers.

这篇关于在jqGrid中,您可以一次内联编辑多个行,然后执行一次提交吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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