我的 table :
<table id="DispalyTable" border="4px" style="width: 100%;" >
<tr>
<td style="width: 137px; height: 137px;" valign="top">
<telerik:RadGrid runat="server">
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn>
<HeaderTemplate>
<asp:CheckBox runat="server" Checked="true" Text="ALL" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</td>
<td style="width: 130px;" valign="top">
<div>
<input id="Alloption" type="checkbox" checked="checked" value="All" onchange="javascript:othercheckboxalloption();" style="color: Black"
/><span style="color: Black">All </span>
<br />
<input id="otherCheckbox2" type="checkbox" value="Accepted" style="color: Black"
class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span style="color: Black">Accepted </span>
<br />
<input id="otherCheckbox3" type="checkbox" value="Contracted" style="color: Black"
class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span style="color: Black">Contracted</span>
<br />
<input id="otherCheckbox4" type="checkbox" value="Pending" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span
style="color: Black">Pending</span>
<br />
<input id="otherCheckbox5" type="checkbox" value="Pre-Authorized" style="color: Black"
class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span style="color: Black">Pre-Authorized</span>
<br />
<input id="otherCheckbox6" type="checkbox" value="Show Deleted" style="color: Black"
class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span style="color: Black">Show Deleted</span>
<br />
<input id="otherCheckbox7" type="checkbox" value="Treated" style="color: Black" class="chkdisplay" onchange="javascript:othercheckbxdisplay();" /><span
style="color: Black">Treated</span>
<br />
<%-- <asp:CheckBox ID="All" runat="server" Checked="true" Text="ALL" ForeColor="Black" /><br />
</div>
</td>
<td style="width: 138px;" valign="top">
<div>
<asp:CheckBox ID="CheckBox8" runat="server" Checked="true" Text="Accepted" ForeColor="Black" /><br />
<asp:CheckBox ID="CheckBox9" runat="server" Checked="false" Text="Appointment" ForeColor="Black" /><br />
<asp:CheckBox ID="CheckBox10" runat="server" Checked="true" Text="Contract #" ForeColor="Black" /><br />
<asp:CheckBox ID="CheckBox11" runat="server" Checked="true" Text="Pre-Auth #" ForeColor="Black" /><br />
<asp:CheckBox ID="CheckBox12" runat="server" Checked="true" Text="TX Coloums" ForeColor="Black" /><br />
</div>
</td>
<td valign="top">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" >
<asp:ListItem Text="Diag Date,Tth,Proc" Value="Diag Date,Tth,Proc"></asp:ListItem>
<asp:ListItem Text="Tth,Diag Date,Proc" Value="Tth,Diag Date,Proc"></asp:ListItem>
</asp:DropDownList>
</div>
</td>
</tr>
</table>
我尝试过的代码:
function notewizardcheckbox() {
$("#DispalyTable").attr("disabled", "disabled");
}
调用上述函数的控件,onchange
事件
<div style=" margin-left:25px; margin-top:17px; float:none;">
<input id="Checkbox1" type="checkbox" value="Note Wizard View" onchange="javascript:notewizardcheckbox();" /><span
style="color: Blue; font-size:21px; margin-left:6px;" >Note Wizard View</span>
</div>
最佳答案
要禁用表中的所有表单控件,您可以执行以下操作:
$('#DispalyTable :input').prop('disabled', true);
:input
selector将选择输入、文本区域、选择和按钮元素。
如果 Telerik/.Net 控件不是“正常”html 表单元素,但它们具有 disabled
属性,那么您可以尝试以下操作:
$('#DispalyTable td').find('*').prop('disabled', true);
也就是说,选择表格单元格内的所有元素,并将disabled
设置为true
(尽管这可能不会使对其中一些人来说是有意义的)。
关于javascript - 使用 ASP.net 控件和 Telerik 控件禁用表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17063141/