1. No load from content? is that planned.
2. if I try .Content(@<text>@Html.Action("getCompanyForm", "Companies")</text>) it fails spectacularly. pushes the content out of the content container completely and puts it below the content below the container "outside" in the dom. I was hoping that i could change the content dynamically by loading a different partial view with a specific parameter.
3. Cannot configure so that it doesn't shrink to icons by default?
1 Answer, 1 is accepted
Hi Patrick,
The Kendo UI Drawer's content configuration accepts an HTML string. If you would like to load the content from a partial view, you would have to make use of the jquery.ajax() request.
1. Set the content to an empty element:
.Content("<div id='drawerContainer'></div>")
2. In the document.ready load the view in the content:
$(function (e) { $.ajax({ url: "/Home/MyCustom", method: 'GET', success: function (result) { $('#drawerContainer').html(result); } }); });
3. Return the partial view:
public ActionResult MyCustom() { return PartialView("GridPartialView"); }
As per not allowing it to collapse by default, simply subscribe to the Change event of the Drawer and prevent the execution:
function onHide(e) {
e.preventDefault();
}
This way, it would close only if the user clicks on the "sandwich" icon.
As per the LoadContentFrom functionality, I would recommend that you submit a feature request at our public Feedback portal at:
https://feedback.telerik.com/kendo-jquery-ui
Let me know in case additional assistance is required.
Best regards,
Tsvetomir
Progress Telerik
This is great. I have that working, now I want to go to each different partial view by clicking the drawer. How do I get the drawer name for "onItemClick" (sorry if my js is wrong, I'm rusty):
This seems to work:
Hi Russell, indeed, you could use that approach to gather the id of the widget. Alternatively, you could access it as follows:
e.sender.element.attr("id")
That syntax doesn't work for me?
I tried
var itm = e.sender.element.attr("data-id");
and
var itm = e.sender.element.attr("id");