0

MY 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>

Code I Tried:

 function notewizardcheckbox() {
            $("#DispalyTable").attr("disabled", "disabled");
        }

control on which the above function is called, onchange event

<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>
2
  • When you say "disable table", do you mean "disable all form elements inside that table"? (Actual <table> elements don't really have a concept of disabled or enabled.) Commented Jun 12, 2013 at 10:30
  • @nnnnnYes disable all content in table Commented Jun 12, 2013 at 10:31

2 Answers 2

1

To disable all form controls in the table you can do this:

$('#DispalyTable :input').prop('disabled', true);

The :input selector will select input, textarea, select and button elements.

If the Telerik / .Net controls are not "normal" html form elements but they have a disabled property then you could try this:

$('#DispalyTable td').find('*').prop('disabled', true);

That is, select all of the elements within the cells of the table and set disabled to true (even though that may not make sense for some of them).

Sign up to request clarification or add additional context in comments.

3 Comments

I tried but only the controls with input gets disabled but not my telerik and asp.net controls
Thank u for ur rply.you are saying right but how can i disable telerik,asp.net controls.Is there no way of directly disabling the whole Table at once
Are you saying my second suggestion doesn't work? <table> elements don't have a concept of "disabled", so you have to select the elements within the table and disable them on an individual basis (jQuery gives you shortcuts to select them as a group as shown in my answer, but inside the jQuery code it loops over them all applying the disabled property to them individually).
1

This jQuery will disable all input element inside '#DispalyTable' div.

$('#DispalyTable input').each(function(){
  $(this).attr('disabled','disabled');
}

3 Comments

I tried but only the controls with input gets disabled but not my telerik and asp.net controls
Can you look into/share the rendered html for your telerik & asp.net controls which are causing problem?
Is there no way of directly disabling the whole Table at once

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.