禁用jQGrid中的一行 [英] Disable a row in jQGrid

查看:124
本文介绍了禁用jQGrid中的一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据全局javascript变量的值禁用网格中的1行.例如,假设此变量的值为123.则应禁用在名为"XYZ"的列中具有123的任何行.

I want to disable 1 row on my grid depending on the value of a global javascript variable. For example, lets say the value of this variable is 123. Then any row which has 123 in a column called "XYZ" should be disabled.

实现这种功能的最佳方法在哪里?内部loadcomplete或beforeselectrow吗?

where would be the best way to implement such a functionality ? inside loadcomplete or beforeselectrow ?

谢谢

推荐答案

内联编辑模式的最佳方法是在行中添加not-editable-row类.您可以使用rowattr根据某些列的内容添加类.有关详细信息,请参见答案.

The best way for inline editing mode is adding not-editable-row class to the row. You can use rowattr to add the class based on the content of some column. See the answer for details.

如果使用表单编辑,则必须选择另一种方式.如果您使用navGrid,则可以根据所选行的列中的值禁用某些编辑或隐藏按钮.参见答案这一个了解更多信息. beforeSelectRow是进行此类更改的好地方.

If you use form editing you have to choose another way. It you use navGrid then you can disable some editing or hide buttons based on the value in the column of selected row. See the answer and this one for more details. beforeSelectRow is good place for such changes.

这篇关于禁用jQGrid中的一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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