This is a migrated thread and some comments may be shown as answers.

How to find the parent grid in a opened Kendo window

1 Answer 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
york
Top achievements
Rank 1
york asked on 24 Nov 2015, 05:12 AM

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.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 24 Nov 2015, 09:00 AM
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
Tags
Grid
Asked by
york
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or