This is a migrated thread and some comments may be shown as answers.

kendoWindow

5 Answers 477 Views
Window
This is a migrated thread and some comments may be shown as answers.
Santiago
Top achievements
Rank 1
Santiago asked on 17 Jul 2012, 03:02 PM
Hello im using KendoWindow and works fine but i can't find how to pass parameter, now im using MVC and passing the parameter throw slash number, is any other way?

        $(document).ready(function () {
            $("#window").kendoWindow({
                content: "AjaxContent/5",
                title: "Async Window Content"
            });
        });

Thanks
Santiago.

5 Answers, 1 is accepted

Sort by
0
Phil
Top achievements
Rank 2
answered on 19 Jul 2012, 12:16 AM
Hi Santiago:

Need a control to place a value and then add it to the action string.
var id = "5";
$(document).ready(function () {
    $("#window").kendoWindow({
        content: "/Window/AjaxContent/" + id,
        title: "Async Window Content"
    });
});

Phil
0
Phil
Top achievements
Rank 2
answered on 19 Jul 2012, 10:05 PM
Hi Santiago:

I went for a walk with my wife, so I just posted my last post.  Here is a more complete solution.  I am accessing the Northwind db employee table.  I am displaying an id from an input numeric textbox:
<label for="employId">Employee Id:</label>
<input id="employId" style="width:90px" />
<button id="open" class="k-button">Open</button>
<div id="kjWindow"></div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#employId").kendoNumericTextBox(
        {
            placeholder: "Enter Employee Id",
            max: "9", min: "1", value: "2"
        });
        //
        $("#open").bind("click", winOpen);
    });
    function winOpen() {
        var id = document.getElementById("employId").value;
        $("#kjWindow").kendoWindow({
            title: "Employee Detail",
            width: "750px",
            height: "480px",
            content: "/Windows/EmployeeDetail_View/" + id,
            modal: true,
            actions: ["Close", "Refresh", "Maximize"]
        });
    }
</script>

Phil
P.S.
I changed the winOpen to:
var kW = $("#kjWindow").kendoWindow({
    ...
}).data("kendoWindow");
kW.open();
0
Santiago
Top achievements
Rank 1
answered on 19 Jul 2012, 10:08 PM
Perfect, but is there any other way to pass parameter ? 

Thanks
0
Phil
Top achievements
Rank 2
answered on 24 Jul 2012, 11:53 PM
Hi Santiago:

The docs say
kW.refresh({
    url: "/Windows/EmployeeDetail_View/",
    data: { id: id }
});
should work, but I have not been able to consistently get it to work.  It works only once.

Phil
0
Phil
Top achievements
Rank 2
answered on 29 Aug 2012, 01:47 AM
Hi Santiago:

I am back to Windows, so I got my last suggestion to work as follows:
function winOpen() {
    var eId = document.getElementById("employId").value;
    //
    kjWin = $("#kjWindow").kendoWindow({
        title: "Employee Detail",
        width: "750px",
        height: "480px",
        modal: true,
        actions: ["Close", "Refresh", "Maximize"]
    }).data("kendoWindow").refresh({
        url: "/Grid/EmployeeDetail_View/",
        data: { id: eId }
    });
    kjWin.open();
}
Hope it helps...
Phil
Tags
Window
Asked by
Santiago
Top achievements
Rank 1
Answers by
Phil
Top achievements
Rank 2
Santiago
Top achievements
Rank 1
Share this question
or