0

次のようなコンテンツとして、部分的なビュー (剣道グリッドを含む) で剣道ウィンドウを開く関数を用意します。

$('#CodUnePai').keydown(function (event) {
        if (event.keyCode == 115) {
            event.preventDefault();
            var myWindow = $("#dialog").kendoWindow({
                actions: ["Minimize", "Maximize", "Close"],
                content: {
                    url: '@Url.Action("BSfunePartial","BSfune")',
                },
                draggable: true,
                height: "300px",
                width: "300px",
                modal: false,
                position: {
                    top: 300,
                    left: 1200
                },
                resizable: true,
                title: "Unidades de Negócio",
                visible: false
            });
            $("#dialog").data("kendoWindow").center();
            $("#dialog").data("kendoWindow").open();
        }
    });

次のようにグリッドをクリックすると、CodUnePai にデータが渡されます。

$("#BSfunePartialGrid").click(function (e) {
    var selectedItem = e.target.innerText;
    this.ownerDocument.forms.FormCreate.CodUnePai.value = selectedItem;
});

しかし、私もウィンドウを閉じたいです。グリッドのクリックまたはダブルクリック イベントでどうすればそれを行うことができますか? 手伝ってくれますか?ありがとうございました。:)

4

1 に答える 1

0

あなたは2つの方法でそれを行うことができます

クローズインアクションを追加する第 1 の方法

$("#termWindow").kendoWindow({
                    modal: true,
                    visible: false,
                    resizable: true,
                    width: "700px",
                    title: "TopUp - Terms & Condition",
                    actions: [
                        "Pin",
                        "Minimize",
                        "Maximize",
                        "Close"   

                    ]

                });

2番目に、テンプレート内に閉じるボタンを追加し、閉じる関数を呼び出します

<div id="dialog"></div>
<script type="text/x-kendo-template" id="MessageBoxTemplate">
        <div id="MessageBox-container">
            <em>#= Message # </em>
            <div style="text-align:center">
                <input type="button" id="btnclose" name="btnclose" value="Close" onclick="closeMessageBox()">    
            </div>
        </div>
 </script>

//Close Function MessageBox
        function closeMessageBox(e)
        {
            $("#MessageBox").data("kendoWindow").close();
        }
于 2014-02-14T12:23:55.397 に答える