Preventing popup from closing after saving

2 posts, 0 answers
  1. Nicholas
    Nicholas avatar
    4 posts
    Member since:
    Mar 2020

    Posted 07 Apr 2020 Link to this post

    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.

  2. Martin
    Admin
    Martin avatar
    299 posts

    Posted 09 Apr 2020 Link to this post

    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.
Back to Top