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

Prevent Edit Popup from Closing after Saved Successfully

3 Answers 469 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 03 Dec 2018, 08:40 PM

After user saved the data in Popup, I want to prevent it from closing so user can adjust the data a little bit and then saved again many times.

How can I do that?  Thanks.

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 04 Dec 2018, 10:21 AM
Hi Bertha,

We have a how-to that illustrates how the behavior you describe can be implemented. Check it out below and let me know how it works for you.



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
James
Top achievements
Rank 1
answered on 29 Apr 2020, 10:07 PM
As of Kendo UI 2019-ish, the above example breaks the popup editor cancel button.
0
Viktor Tachev
Telerik team
answered on 30 Apr 2020, 02:07 PM

Hi James,

 

Thank you for reporting the behavior to us. In order to close the popup with the Cancel button after update I would suggest the change below. The code closing the popup is added in the edit event handler.

edit: function (e) {
	var editWindow = this.editable.element.data("kendoWindow");
	editWindow.unbind("close");
	editWindow.bind("close", onWindowEditClose);
	$(".k-grid-cancel").one("mousedown", function (e) {
	  preventCloseOnSave = false;
	  editWindow.close();
	});
},

 

Check out the updated dojo below for reference:

https://dojo.telerik.com/UTOsUNAQ

 

Regards,
Viktor Tachev
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.
George
Top achievements
Rank 1
commented on 10 Aug 2022, 06:16 PM

Using the provided dojo if you hit the "Add New Record" button. Then hit "Cancel". The Add New Record button becomes unusable. I am trying to use this in my project but that bug makes it pretty unusable. I'm having trouble finding a work around. Any suggestions? 
Viktor Tachev
Telerik team
commented on 12 Aug 2022, 07:51 AM

Thank you for bringing this to our attention. There was a JavaScript error that prevented the code from executing. In order to avoid it you can use the following definition of the edit event handler:

edit: function (e) {
            var editWindow = e.container.data("kendoWindow");
            editWindow.unbind("close");
            editWindow.bind("close", onWindowEditClose);
            $(".k-grid-cancel").one("mousedown", function (e) {
              preventCloseOnSave = false;
              editWindow.close();
            });
          },

 

An updated version of the dojo is available below:

https://dojo.telerik.com/UTOsUNAQ/16

 

I have also fixed the code in the documentation and it should be live soon.

Tags
Grid
Asked by
Bertha
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
James
Top achievements
Rank 1
Share this question
or