0

When I open the jquery dialog everything works just fine, until I try to close it, either by selecting a user or pressing escape. Then the jquery dialog box goes away, but the shading/mask from the modal option will not go away. I forced my app to use Jquery 1.8.3 and it worked just fine. I can not find what change would do this. Any help is awesome thanks!

$("#user_id_mask").focus(function()
        {
            $("#user_selection_dialog").dialog(
            {
                width: 500,
                height: 400,
                modal: true
            });
        });

        $("#first_name").keyup(function()
        {
            if($.trim($(this).val()).length >= 2)
                $.get("/admin/users/get_options?first_name=" + $.trim($(this).val()) + "&last_name=" + $.trim($("#last_name").val()), updateUserResults);
        });

        $("#last_name").keyup(function()
        {
            if($.trim($(this).val()).length >= 2)
                $.get("/admin/users/get_options?last_name=" + $.trim($(this).val()) + "&first_name=" + $.trim($("#first_name").val()), updateUserResults);
        });

        $("#user_search_results").on("click", "tr", function(event)
        {
            $("#<%= f.object.class.to_s.underscore %>_user_id").val($(this).data("userId"));
            $("#user_id_mask").val($(this).data("label"));
            $("#user_selection_dialog").dialog("close");
        });

        function updateUserResults(data)
        {
            if(!data)
            {
                $("#user_search_results").empty();
                $("#user_search_results").append("<tr><td colspan='5'>No results</td></tr>");
            }
            else
            {
                $("#user_search_results").empty();
                for(var i in data)
                {
                    $("#user_search_results").append("<tr data-user-id='" + data[i]["id"] + "' data-label='" + data[i]["first_name"] + " " + data[i]["last_name"] + " [" + data[i]["id"] + "]'><td>" + data[i]["id"] + "</td><td>" + data[i]["first_name"] + "</td><td>" + data[i]["last_name"] + "</td><td>" + data[i]["city"] + "</td><td>" + data[i]["state"] + "</td></tr>");
                }
            }
        }
4

1 回答 1

0

您是否有任何实用程序可以保留模式?用户可以稍后重新打开它吗?如果不是,如果您替换"close""destroy"怎么办?

于 2013-07-30T15:33:57.510 回答