Drawer Questions

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    30 posts
    Member since:
    Jan 2018

    Posted 18 Sep 2019 Link to this post

    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?

  2. Tsvetomir
    Admin
    Tsvetomir avatar
    796 posts

    Posted 20 Sep 2019 Link to this post

    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

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top