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

Preventing popup from closing after saving

1 Answer 140 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 07 Apr 2020, 10:11 PM

Okay first thing, I'm trying to get this functionality working in our implementation;

https://docs.telerik.com/kendo-ui/knowledge-base/grid-prevent-popup-close-on-edit
https://dojo.telerik.com/UKobIzuN

 

Using the dojo example linked above, there is a line that does not work in our version.

var editWindow = this.editable.element.data("kendoWindow");

 

When I try that in ours, it just crashes.  For reference, our version looks like this;

$("#scheduler").kendoScheduler({
    //bunch of stuff
    editable: editable,
    edit: function (ePopupEdit) {
        //bunch of stuff
        var editWindow = this.element.data("kendoWindow");
        editWindow.unbind("close");
        editWindow.bind("close", onWindowEditClose);
 
    //bunch more stuff
    },
    save:  function (e) {
        preventCloseOnSave();
    },
)};

What am I doing wrong?

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 09 Apr 2020, 02:42 PM

Hello Nicholas,

Thank you for the provided resources.

The problem is that this.element is not the element from which the Window is initialized, and therefore editWindow is undefined. 

Here you will find a Dojo example demonstrating the functionality in the Scheduler:

edit:function(e){
  var wnd = $("div[data-role='window']").data("kendoWindow");
  wnd.bind("close", onWindowEditClose);
},

Let me know if you have any questions regarding the above.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Window
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or