tulkas85
tulkas85

Reputation: 1103

asp.net and jQuery ui dialog issue on modal:true

I have a div that contains an Asp checkboxlist and is opened by jquery ui dialog . I need to manage the postback too, so I add

.parent().appendTo($("form:first"));

The problem is that when dialog is opened all DOM is disabled, it seems that modal:true is extended to all DOM

this is aspx code :

   <script type="text/javascript">
    $(function () {
        $("#modalDialog").dialog({
            autoOpen: false,
            height: 300,
            width: 350,
            modal: true,
            buttons: {
                "Salva": function () {
                    $("[id*=btn_save]").click();
                },
                "Annulla": function () {
                    $(this).dialog("close");
                }
            },
            close: function () {
            }
        });
        $("#modalDialog").parent().appendTo($("form:first"));
    });
</script>
<div id="modalDialog" >
            <asp:CheckBoxList ID="ckb_eventi" runat="server" DataTextField="NOME" DataValueField="ID_CASSA">
            </asp:CheckBoxList>

        </div>
          <asp:Button ID="btn_save" runat="server" Text="Salva" style = "display:none" OnClick = "btn_save_Click" />

Upvotes: 0

Views: 805

Answers (1)

tulkas85
tulkas85

Reputation: 1103

I solved using jquery ui dialog option :

appendTo: "form:first"

instead of using

$("#modalDialog").parent().appendTo($("form:first"));

Upvotes: 1

Related Questions