How to find the parent grid in a opened Kendo window

2 posts, 1 answers
  1. york
    york avatar
    160 posts
    Member since:
    Jul 2012

    Posted 23 Nov 2015 Link to this post

    Hi,

    I have a Kendo grid in which a Kendo window is opened when you click on each row. The code is:

            <% Html.Kendo().Grid<EvaluationsQuestionsEvaluationVersionGridViewModel>(Model.VersionsGridModel)
                .Name("Versions")

    ......
                .Columns(columns =>
                {
                    columns.Bound(s => s.VersionId)
                        .Width(180);
                    columns.Bound(s => s.OrganizationTypeName)
                        .Width(180);

    ......          columns.Command(commands =>
                    {
                           commands.Custom("Copy").Click("copyEvaluationVersion");
                           commands.Edit();
                    })

            <% Html.Kendo().Window()
                .Name("CopyVersion")
                .Title()
                .Content(() =>
                    { %>

    ......                  <input type="submit" value="Submit"  />
                           <input type="hidden" id="copyEvaluationVersionId" name="copyEvaluationVersionId" value="<%= ViewData["evaluationVersionId"] %>" />
                        <% } %>
                    <%})
                .Draggable(true)
    ......

            $("#CopyEvaluationSubmit").click(function (e) {
                var yearCombo = $("#copyToYear").data('kendoDropDownList');
                SetRingCookie('ck_year', yearCombo.text(), { path: '/' });
                return true;
            });
            
            function copyEvaluationVersion(e) {
                $("#CopyVersion").data("kendoWindow").open();
                $("#copyToYear").data('kendoDropDownList').read();
            }

    I want to know how to find the parent grid Name("Versions") in $("#CopyEvaluationSubmit").click(function (e), which is invoked when submit button is clicked in Kendo window.  Thanks.

     

  2. Answer
    Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 24 Nov 2015 Link to this post

    Hi york,

    Please check out how to reference an existing Grid instance in the Kendo UI documentation here and here.

    var grid = $("#Versions").data("kendoGrid");

    I hope this helps, but if I am missing something, please describe the desired behavior of the submit button in the Kendo Window, and what prevents you from using the approach shown above.

    Regards,
    Dimiter Topalov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top