How to Destory kendo window popup in close action in kendo UI

Viewed 6300

Am using kendo window for popup, when click on close anchor tag, it will close model window, but it sits in DOM. I wanted to destroy the model pop up. Below is my code. I tried this.destory() in close action, but it is not destroying. Please help me.

var selectRowsDialog = $("#select-Rows-dialog").kendoWindow({
            width: "800px",
            title: "Select rows",
            autoOpen: false,
            closable: true,
            modal: true,
            visible: false,
            close: function () { 
            },       
        }).data("kendoWindow").center().open();
3 Answers

@Kranthi, that happens when you make a infinite loop in javascript. So, probably you are calling the kendoWindow.close method in the Deactive event handler. And he is getting stuck there, because when he calls close events que also calls deactivate, so there you go that "Maximum call stack size exceeded". There are two options to either destroy your window or clean totally your model. (There is probably a third, which is to erase the iframe from within of the kendoWindow and create it back, not my best choice) so: 1.On your load page method always fill empty your model or well, how ever you have it handled just, send it empty if it goes empty, but litarally like

    Model.id = ""

2.On close event of your window call the method destroy(), but when you have to open again your window you'll have to call everything back from the begining, like creating one more time your controls. Thats up to you.

I had to use both constantly, because i have a big, big, app which has like hundreds of PopUps and using kendoWindow let them open if you don't destroy them.

Related