刷新用户控件文本更改事件的部分页面

时间:2016-09-23 04:23:26

标签: javascript jquery asp.net vb.net

我有一个带有一些单选按钮的Usercontrol文本框。 我想在更改usercontrol文本框值时刷新其中一些按钮。

简而言之,当我选择特定按钮时,它会显示RM row&对于所有单选按钮选择它隐藏RM行。选择RM&检查客户端单选按钮,它再次显示下面的两个单选按钮。通过检查任何无线电,它将显示下面的网格数据。对于Prospect&关闭按钮,在检查后显示下面的网格数据。

对于所有无线电,除RM选择外,所有功能都相同。

我的所有功能都按预期工作,只需要在其中添加一个附加功能。

现在,当我从usercontrol文本框更改RM名称时,我想刷新低于RM用户控制屏幕的5个单选按钮(客户端,潜在客户,已关闭,客户端,系列)。

我尝试使用更新面板,但它无法正常工作,因为它让我感到很乱,所以所有这些都发生了变化。我目前的工作代码如下:

<script type="text/javascript">
    $110 = $;

    $110(document).ready(function () {
        //intial setting of panel
        rdoBtnShowHidePanels();
        $110("#trClient").hide();
        $110("#btnSendSms").hide();
        $110("#trCommMode").hide();
        $110("input[type='radio'][name='First']").attr('checked', false);

        $110("input[type='radio'][name='SelectRM']").change(function () {
            $110("#trClient").hide();
            $110("#jqxContact").hide();
            $110("#trCommMode").hide();

            if ($110("input[type='radio'][id='RdoSpecific']").is(":checked") == true) {
                $110("input[type='radio'][name='First']").attr('checked', false);
                $110("input[type='radio'][name='a']").attr('checked', false);
                $110("#trRM").show();
                $("input[id$=mcscRMSearch_txtSearch]").val('');

                $110("input[type='radio'][name='First']").change(function () {
                    if ($110("input[type='radio'][id='RdoSpecific']").is(":checked") == true) {
                        if (ValidateRMSelection() == true) {

                            $110("#trRM").show();
                            if ($110("input[type='radio'][id='rdoClientAll']").is(":checked") == true) {
                                $110("#trClient").show();
                                $110("input[type='radio'][name='a']").change(function () {
                                    $110("#hdnType").val("C");
                                    $110("#jqxContact").show();

                                    var getselectedrowindexes = $110('#jqxContact').jqxGrid('getselectedrowindexes');
                                    $110('#jqxContact').jqxGrid('unselectrow', getselectedrowindexes);
                                    $110('#jqxContact').jqxGrid('clearselection');
                                    if ($110("input[type='radio'][id='RdoSpecific']").is(":checked") == true) {
                                        BindGridBasedOnRadioButtons();
                                    }
                                    $110("#trCommMode").show();
                                    return;
                                })
                            }
                            else {
                                $110("#hdnType").val("P");
                                $110("input[type='radio'][id='rdoclient']").prop("checked", false);
                                $110("input[type='radio'][id='rdofamily']").prop("checked", false);
                                $110("#trClient").hide();
                                $110("#jqxContact").show();
                                var getselectedrowindexes = $110('#jqxContact').jqxGrid('getselectedrowindexes');
                                $110('#jqxContact').jqxGrid('unselectrow', getselectedrowindexes);
                                $110('#jqxContact').jqxGrid('clearselection');
                                if ($110("input[type='radio'][id='RdoSpecific']").is(":checked") == true) {
                                    BindGridBasedOnRadioButtons();
                                }
                                $110("#trCommMode").show();
                                return;
                            }
                        }
                        else {
                            alert("Select RM");
                            $110("#trClient").hide();
                            $110("#trCommMode").hide();
                            $110("#jqxContact").hide();
                            return;
                        }
                    }
                })
            }
            else {
                $110("#trRM").hide();
                $110("#trCommMode").hide();
                $110("input[type='radio'][name='First']").attr('checked', false);
                $110("input[type='radio'][name='a']").attr('checked', false);
                $110("input[type='radio'][name='First']").change(function () {
                    if ($110("input[type='radio'][id='rdoClientAll']").is(":checked") == true) {
                        $110("#jqxContact").hide()
                        $110("#trClient").show();
                        $110("input[type='radio'][name='a']").change(function () {
                            $110("#hdnType").val("C");
                            $110("#jqxContact").show();
                            var getselectedrowindexes = $110('#jqxContact').jqxGrid('getselectedrowindexes');
                            $110('#jqxContact').jqxGrid('unselectrow', getselectedrowindexes);
                            $110('#jqxContact').jqxGrid('clearselection');

                            BindGridBasedOnRadioButtons1();
                            $110("#trCommMode").show();
                            return;
                        })
                    }
                    else {
                        $110("#hdnType").val("P");
                        $110("input[type='radio'][id='rdoclient']").prop("checked", false);
                        $110("input[type='radio'][id='rdofamily']").prop("checked", false);
                        $110("#trClient").hide();
                        $110("#jqxContact").show();
                        var getselectedrowindexes = $110('#jqxContact').jqxGrid('getselectedrowindexes');
                        $110('#jqxContact').jqxGrid('unselectrow', getselectedrowindexes);
                        $110('#jqxContact').jqxGrid('clearselection');

                        BindGridBasedOnRadioButtons1();
                        $110("#trCommMode").show();
                        return;
                    }
                })
            }
        })

<form id="Form1" method="post" runat="server">
    <asp:ScriptManager ID="scmPhoneBook" runat="server">
    </asp:ScriptManager>

    <table id="Table1" cellspacing="1" cellpadding="0" width="100%" border="0">
        <tr>
            <td class="clsTitle" align="center" style="height: 25px">Contacts
            </td>
        </tr>
        <tr>
            <td class="clstd" align="left" style="width: 100%" colspan="2">
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td class="clstdnext" align="left" style="width: 100%" colspan="2">
                            <asp:RadioButton ID="RdoSpecific" runat="server" GroupName="SelectRM" Text="Specific"></asp:RadioButton>
                            <asp:RadioButton ID="RdoAll" runat="server" GroupName="SelectRM" Text="All"></asp:RadioButton>
                        </td>
                    </tr>
                    <tr id="trRM">
                        <td class="clstd" width="2%">RM
                        </td>
                        <td class="clstd" width="98%">
                            <mwimcs:MultiColumnSearchControl
                                runat="server"
                                ID="mcscRMSearch"
                                CssClass="clsTextbox"
                                Width="300"
                                ControlType="137"
                                DataTextField="usr_name"
                                DataValueField="usr_id"
                                Top="-15px" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="clstdnext" align="left" style="width: 100%" colspan="2">
                <asp:RadioButton ID="rdoClientAll" runat="server" GroupName="First" Text="Client"></asp:RadioButton>
                <asp:RadioButton ID="RdoProspect" runat="server" GroupName="First" Text="Prospect"></asp:RadioButton>
                <asp:RadioButton ID="RdoClosed" runat="server" GroupName="First" Text="Closed"></asp:RadioButton>
            </td>
        </tr>
        <tr id="trClient">
            <td class="clstd" align="left" style="width: 100%" colspan="2">
                <asp:RadioButton ID="rdofamily" runat="server" GroupName="a" Text="Family"></asp:RadioButton>
                <asp:RadioButton ID="rdoclient" runat="server" GroupName="a" Text="Client"></asp:RadioButton>
            </td>
        </tr>

        <tr>
            <td valign="top">
                <div id="jqxContact"></div>
                <asp:Panel ID="PnlClient" runat="server" Width="100%">
                </asp:Panel>
            </td>
            <asp:DataGrid ID="dgCompany" runat="server" Width="100%" AutoGenerateColumns="False"
                AllowSorting="True" AllowPaging="True" PageSize="25">
            </asp:DataGrid>
        </tr>
    </table>

    <br />


    <table width="100%" cellpadding="0" cellspacing="1" border="0">
        <tr height="10px">
            <td class="clsLabel_err" colspan="2">
                <asp:Label ID="lblErrorMsg" runat="server" CssClass="clsLabel_err"></asp:Label>
            </td>
        </tr>
        <tr style="width: 100%" id="trCommMode">
            <td class="clstdnext" style="width: 25%">Communication Mode:</td>
            <td class="clstdnext" align="left" valign="middle">
                <asp:RadioButtonList ID="rbtnlistSmsMail" runat="server" RepeatDirection="Horizontal"
                    Font-Names="Verdana" Font-Size="11px">
                    <asp:ListItem>
                    SMS
                    </asp:ListItem>
                    <asp:ListItem>
                    E-Mail
                    </asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td colspan="2" id="pnlEmailDtls" runat="server">
                <asp:Panel ID="pnlpnlEmailDtls" runat="server" Width="100%">
                    <table id="Table3" cellspacing="1" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td class="clstd" style="width: 25%">Email From</td>
                            <td class="clsTd" style="width: 80%">
                                <cc1:MultiColumnComboBox ID="mmcEmail" runat="server" CssClass="clstd" HeaderCSS="clsReportTitle"
                                    ItemsCSS="clstdnext" VerticalScrolling="True" DownArrowButtonCSS="clsButton"
                                    DownArrowImageURL="url(Images/downarrow.gif)" DownArrowButtonHeight="12" DownArrowButtonWidth="20"
                                    TextBoxCSS="clsTextbox">
                                    <Columns>
                                        <cc1:Column ColumnWidth="" DataField="email" KeyColumn="True" HeaderText="Email"></cc1:Column>
                                        <cc1:Column ColumnWidth="" DataField="smtp" KeyColumn="False" HeaderText="SMTP"></cc1:Column>
                                    </Columns>
                                </cc1:MultiColumnComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="clstdnext" style="width: 20px">Subject</td>
                            <td class="clstdnext" style="width: 80px">
                                <asp:TextBox ID="txtSubject" runat="server" CssClass="clsTextbox" Width="327px">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="clstd">Attachment 1)
                            </td>
                            <td class="clstd">
                                <input class="clsTextbox" id="fileupload1" style="width: 250px" type="file" size="48" runat="server"
                                    name="fileupload1" />
                            </td>
                        </tr>
                        <tr>
                            <td class="clstdnext">Attachment 2)
                            </td>
                            <td class="clstdnext">
                                <input class="clsTextbox" id="fileupload2" style="width: 250px" type="file" size="48" runat="server"
                                    name="fileupload2" />
                            </td>
                        </tr>
                        <tr>
                            <td class="clstd">Attachment 3)
                            </td>
                            <td class="clstd">
                                <input class="clsTextbox" id="fileupload3" style="width: 250px" type="file" size="48" runat="server"
                                    name="fileupload3" />
                            </td>
                        </tr>
                        <tr>
                            <td class="clsReportTitle" align="center" style="width: 100%" colspan="2">Message
                            </td>
                        </tr>
                        <tr>
                            <%--<TD width="100%" colSpan=2> 
                            <asp:TextBox id=txtMessage runat="server" CssClass="clsTextbox" Width="100%" TextMode="MultiLine" Height="250px"></asp:TextBox></TD>--%>
                            <td align="left" class="clstd" colspan="2">
                                <ftb:FreeTextBox ID="FreeTextBox1" EnableHtmlMode="false" ToolbarLayout="ParagraphMenu, FontFacesMenu, FontSizesMenu, FontForeColorsMenu,FontForeColorPicker, FontBackColorsMenu, FontBackColorPicker, Bold, Italic, Underline,Strikethrough, Superscript, Subscript|InsertImageFromGallery, CreateLink, Unlink, JustifyLeft, JustifyRight, JustifyCenter, JustifyFull,BulletedList, NumberedList, Indent, Outdent,Cut, Copy, Paste, Delete, Undo, Redo,Save,InsertRule, InsertDate,InsertTime,Preview"
                                    Height="300px" runat="server" Width="100%">
                                </ftb:FreeTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100%" class="clstd_btn" colspan="2">
                                <%--<input id="BtnSendEmail" type="button" class="clsButton" value="Send"/>--%>
                                <asp:Button ID="BtnSendEmail" runat="server" OnClientClick="return ValidationBeforeEmailSendClick();" CssClass="clsButton" Text="Send"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td colspan="2" id="pnlSmsDtls" runat="server">
                <asp:Panel ID="pnlpnlSmsDtls" runat="server" Width="100%">
                    <table cellspacing="1" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td class="clstd" style="width: 25%">SMS Type
                            </td>
                            <td class="clstd">
                                <asp:DropDownList ID="ddlSmsType" CssClass="clsCombobox" runat="server">
                                    <asp:ListItem Value="0">---Select---</asp:ListItem>
                                    <asp:ListItem Value="1">Upcoming maturity/due date</asp:ListItem>
                                    <asp:ListItem Value="2">New product offerings</asp:ListItem>
                                    <asp:ListItem Value="3">Pick of the day</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="clstdnext">SMS Text
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="clstdnext" style="height: 40px">
                                <asp:TextBox ID="txtSmsText" runat="server" CssClass="clsTextbox" TextMode="MultiLine"
                                    Width="100%" Height="100px">
                                </asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="clstd_btn">
                                <input type="button" id="btnGo" value="Save" class="clsButton" />
                                <%--<asp:Button ID="btnGo" runat="server" CssClass="clsButton" Text="Save" />--%>
                                <asp:Button ID="btnSendSms" runat="server" CssClass="clsButton" Text="Send SMS"
                                    Width="72px"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <input type="hidden" id="hdnType" />
</form>

它的银色...请帮助。

提前致谢。

0 个答案:

没有答案