How to make an entire jqGrid disabled/readonly

橙三吉。 提交于 2020-01-13 16:22:13

问题


How can I make an entire jqGrid disabled/readonly?

I have a page with a logical "edit section" which I show when the user selects something to edit, and hide when the user is done editing (save or cancel). While the edit section is shown, I disable several other elements on the page. I would like to disable their ability to click in the jqGrid, so they can't change selected rows, re-sort, etc. But I cannot find a way to disable/enable the grid as a whole.

Apologies if this has been answered already - other questions seemed to focus on disabling only certain behaviors within the jqGrid.

Edit: Preferably, I'd like an approach that isn't dependent on yet another 3rd-party addon. Nothing wrong with them, of course! But my client has a degree of reluctance with them, so my life would be a little easier with a purely jQuery/jQueryUI/jqGrid solution. :)


回答1:


You could use blockUI to block the grid.




回答2:


Try using $("#lui_" + myGridId).show().

The grid has created this overlay internally an uses it as one part of the loader message. You can just show it or hide it and it will disable/enable the grid for you.



来源:https://stackoverflow.com/questions/3206912/how-to-make-an-entire-jqgrid-disabled-readonly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!