禁用表中的控件-JQuery/Javascript [英] Disabling controls within a table - JQuery/Javascript

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

问题描述

我有一个复杂的UI,其中包含几个嵌套表,一个转发器控件和几个其他HTML控件,这些控件的禁用属性是根据JQuery中的业务逻辑设置的.

I have a complex UI with several nested tables, a repeater control and several other HTML controls that have their disable attribute set based on business logic in JQuery.

我需要一种禁用整个表(包括嵌套控件,UI元素等)并在用户切换按钮时重新启用它们的方法.

I need a way to disable the entire table (including nested controls, UI elements etc) and re-enable them when a user toggles a button.

我可以遍历控件,找到每个控件并应用"disable"属性,但是当用户选择启用时,我将需要检查每个控件是否最初处于启用状态. (基于第1段中所述的业务逻辑)

I could iterate through the controls, find each of them and apply the "disable" attribute, but when the user chooses to enable, I will need to go through the trouble of checking if each of the control was initially enabled or not (based on the business logic as explained in para 1)

我需要的是一种不使用初始UI并在UI上覆盖禁用/启用功能的方法.

All I need is a way to leave the initial UI alone and overlay the disable/enable functionality on the UI.

有没有简单的方法可以做到这一点?

Is there a easy way of accomplishing this?

推荐答案

检出 blockUI 插件.您可以在整个表格上放置一个灰色的div.

checkout the blockUI plugin. you can put a grey div over the entire table with it.

这与禁用每个表控件具有相同的效果.

This will have the same effect as disabling every table control.

这篇关于禁用表中的控件-JQuery/Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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