I am using "appendTo" to place the Window inside the form. I receive an array with checked values for "checkedNodes" from the TreeView after the postback in FormCollection, but their values are "undefined". The values seem to be binding fine on the client side since I can check that there with no problem.
@* ++++++ View ++++++ *@
@using (Html.BeginForm(null, null, FormMethod.Post, new { name = "frmFind", id = "frmFind" }))
{
@Html.LabelFor(m => m.Things)
@(Html.Kendo().Window()
.Name("windowThings")
.Title("Things")
.Draggable()
.Actions(actions => actions
.Minimize()
.Maximize()
.Close()
).Visible(false)
.Resizable().Scrollable(true).Height(350)
.Content(@<text>
@(Html.Kendo().TreeView()
.Name("treeThings")
.Checkboxes(checkboxes => checkboxes
.CheckChildren(true)
)
.DataTextField("Value")
)
</text>)
)
<span id="buttonOpenThings" class="k-button">Select Things</span>
<script type="text/javascript">
$("#windowThings").kendoWindow({
appendTo: "#frmFind"
});
</script>
}
// ++++++ Controller ++++++
[HttpPost]
public ActionResult Index(FormCollection values)
{
var checkedNodes = values["checkedNodes"]; // result is "undefined, undefined, undefined, [etc]"
return View();
}
@* ++++++ View ++++++ *@
@using (Html.BeginForm(null, null, FormMethod.Post, new { name = "frmFind", id = "frmFind" }))
{
@Html.LabelFor(m => m.Things)
@(Html.Kendo().Window()
.Name("windowThings")
.Title("Things")
.Draggable()
.Actions(actions => actions
.Minimize()
.Maximize()
.Close()
).Visible(false)
.Resizable().Scrollable(true).Height(350)
.Content(@<text>
@(Html.Kendo().TreeView()
.Name("treeThings")
.Checkboxes(checkboxes => checkboxes
.CheckChildren(true)
)
.DataTextField("Value")
)
</text>)
)
<span id="buttonOpenThings" class="k-button">Select Things</span>
<script type="text/javascript">
$("#windowThings").kendoWindow({
appendTo: "#frmFind"
});
</script>
}
// ++++++ Controller ++++++
[HttpPost]
public ActionResult Index(FormCollection values)
{
var checkedNodes = values["checkedNodes"]; // result is "undefined, undefined, undefined, [etc]"
return View();
}