I have a window (apologies for bolding... seems easiest way to distinguish code given limited formatting options)
@(Html.Kendo()
.Window()
.Name("UserPermissionsWindow")
.Title("User Privileges")
.Content("loading privlege settings...")
.Iframe(true)
.Draggable()
.Resizable()
.Visible(false))
opened by a button click from a grid row:
columns.Command(com => com.Custom("Privileges")
.Click("openUserPermissionsWindow"));
The click handler calls the window refresh button:
<script type="text/javascript">
function openUserPermissionsWindow(e) {
e.preventDefault();
// the dataitem retrieved here will have the field values that can subsitute in the template (I hope)
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
personId = dataItem.Person_ID; //will this work?????
var wnd = $("#UserPermissionsWindow").data("kendoWindow");
wnd.refresh({
url: "UserPrivileges/" + personId, // what does this url need to look like?
data: { id: personId }
});
wnd.center().open();
}
</script>
And the action returns a partialview containing a treeview wrapper:
<b>yo 'sup?</b>
@( Html.Kendo()
.TreeView()
.DataTextField("Name")
.Name("userModulePermissions")
.Checkboxes(cbxConfig => cbxConfig.Enabled(true)
.CheckChildren(true)
.Name("checkedNodes"))
.DataSource(d => d.Read(read => read.Action("PermissionsTree_Read",
"SettingsUsers",
new {
userId = Model
})))
)
But I end up with javascript error: ReferenceError: jQuery is not defined
This is "fixed" by putting the jquery (and kendo?) bundles at the top of the PARTIAL view:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
But because this is a PartialView in a window on a page that already exists, shouldn't it be able to use the jquery library that is already on the page?
I don't think I should have to bundle jquery libraries on partial views.
Currently the jquery bundle is at top of layout page.
Please advise.