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

modal window closing issue

1 Answer 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
guru
Top achievements
Rank 1
guru asked on 21 Feb 2013, 02:52 PM
I have a grid and a custom button column. I am calling an another .Net page which has another kendo grid.


{command: { text:

 

"Devices", click: ShowDevicePage }, title: " ", width: "120px" },

 


 

                function ShowDevicePage(e) {

                        e.preventDefault();

                        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
                        var url = "AssignDevice.aspx?DRC=" + dataItem.id;

                        $(document.body).append('<div id="myDynamicWindow"></div>');

                        var wnd = $("#myDynamicWindow").data("kendoWindow");

                        wnd = $("#myDynamicWindow").kendoWindow({
                            title: "Devices",
                            content: url,
                            width: "950",
                            height: "450",
                            visible: false,
                            modal: true,

                            close: function () {
        
        //Refresh the Grid
                                var childGrid = $(e.delegateTarget).closest(".k-grid").kendoGrid().data("kendoGrid");
                                childGrid.dataSource.read();

                                $(e.delegateTarget).closest(".k-grid").kendoGrid().data("kendoGrid").refresh();
                            
                            }

                        }).data("kendoWindow");
                               

                                wnd.center();
                                wnd.open();
                    }  //ShowDevicePage

 

 On close of the modal Window I need to reload the Grid which is in the calling page. How do i do that?

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 25 Feb 2013, 10:08 AM
Hello,

You should remove the initialization code:
 

var childGrid = $(e.delegateTarget).closest(".k-grid").kendoGrid().data("kendoGrid");
Currently the Grid will be reinitialized and the data will be overridden. 

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
guru
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or