0

ファイルをダウンロードするリンクがありますが、プロセスに時間がかかる場合があるため、ダウンロードが行われていることをユーザーに通知する JQ モーダル ダイアログを表示したいと考えています。

JQuery モーダルの使用: http://jqueryui.com/demos/dialog/#modal

@model MvcResComm.Models.FileList

@{
    ViewBag.Title = "Download";
}

<script src="../../Scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $('a').click(function () {
            $("#dialog-modal").dialog({
                height: 140,
                modal: true
            }, 'open');
        });
    });
</script>

<h2>Download</h2>

<table>
@foreach (KeyValuePair<string, string> item in Model.Files) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Value)
        </td>
        <td>
            @Html.ActionLink("Download", "DownloadFile", new { fileid = item.Key, token = Model.Token, platform = "windows" })
        </td>
    </tr>
}

</table>
<div id="dialog-modal" title="Basic modal dialog">
    <p>Download in progress.</p><span class="loading">&nbsp;</span>
</div>
4

1 に答える 1

1

jQuery UI 1.8.20 で JQuery 1.8 を使用しています。

少なくとも jQuery UI 1.8.22 が必要なようです。

デモ- jQuery UI 1.8.20 で jQuery 1.8 を使用する

(ajax.aspnetcdn.com/ajax/jquery.ui/1.8.20/jquery-ui.js を使用)

上記のデモでは、コンソールに次のように表示されるエラーが発生します。
TypeError: match is undefined: return !!$.data( elem, match[ 3 ]);

デモ- jQuery UI 1.8.22 で jQuery 1.8 を使用する

(ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js を使用)

jQuery UI 1.8.22 でまだ問題が発生している場合は、カスタム jQuery 1.8.23 ファイルが何かに干渉している可能性があります。

于 2012-08-24T13:11:45.127 に答える