I'm following the basic model of displaying a window from an action in a Kendo Grid. The content of the window needs to be loaded via a Partial View from an Action but I cannot figure out how to pass data to the Window so that when it loads the View it can pass that data along. I need to accomplish something akin to the code below.
@(Html.Kendo().Grid<ActivationModel>()
.Name("activationGrid")
.Columns(columns =>
{
columns.Bound(p => p.RawMessageId).Hidden();
columns.Command(command => command.Custom("SendActivation").Text("Re-send Activation Email").Click("sendActivation"));
})
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(20)
.Read(read => read.Action("Activations", "Activation"))
.Model(model => model.Id(k => k.RawMessageId))
)
)
@(Html.Kendo().Window().Name("ActivationWindow")
.Title("Customer Details")
.Visible(false)
.Modal(true)
.Draggable(true)
.Width(300)
.LoadContentFrom("Activation", "ResendActivation", new { rawId = [NEED TO INSERT DATA HERE] })
)
<script type="text/javascript">
function sendActivation(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#ActivationWindow").data("kendoWindow");
wnd.center().open();
}
</script>
@(Html.Kendo().Grid<ActivationModel>()
.Name("activationGrid")
.Columns(columns =>
{
columns.Bound(p => p.RawMessageId).Hidden();
columns.Command(command => command.Custom("SendActivation").Text("Re-send Activation Email").Click("sendActivation"));
})
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.PageSize(20)
.Read(read => read.Action("Activations", "Activation"))
.Model(model => model.Id(k => k.RawMessageId))
)
)
@(Html.Kendo().Window().Name("ActivationWindow")
.Title("Customer Details")
.Visible(false)
.Modal(true)
.Draggable(true)
.Width(300)
.LoadContentFrom("Activation", "ResendActivation", new { rawId = [NEED TO INSERT DATA HERE] })
)
<script type="text/javascript">
function sendActivation(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#ActivationWindow").data("kendoWindow");
wnd.center().open();
}
</script>