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

Canceling Add New Record leaves empty row behind

3 Answers 266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 14 Sep 2017, 05:59 PM
In my Grid, using a custom PopUp editor, when adding a new record, if the user Presses Cancel, the PopUp closes appropriately but there is a blank record left at the top of my grid.  How do I prevent this from happening? I imagine I have to refresh the dataSource, but from where?  

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Sep 2017, 07:16 AM
Hello Joe,

In general, when the cancel button is clicked on a new record the Grid should remove the record automatically.

This can be observed in our demo and in the runnable example with custom popup editor as well:

http://demos.telerik.com/aspnet-mvc/grid/editing-popup

I can assume that there is a custom code which is interfering with the editing functionality. If possible provide a fully runnable example reproducing the issue and I will gladly assist. The attached project can be used as a starting point.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Felix
Top achievements
Rank 1
answered on 27 Mar 2021, 04:23 AM

I have the same problem. The error shows like this...

Uncaught TypeError: e is undefined
    R                   http://localhost:5002/kendoui/js/kendo.all.min.js:27
    z                   http://localhost:5002/kendoui/js/kendo.all.min.js:27
    R                   http://localhost:5002/kendoui/js/kendo.all.min.js:27
    i                   http://localhost:5002/kendoui/js/kendo.all.min.js:28
    _eachItem           http://localhost:5002/kendoui/js/kendo.all.min.js:28
    _eachPristineItem   http://localhost:5002/kendoui/js/kendo.all.min.js:28
    _pristineForModel   http://localhost:5002/kendoui/js/kendo.all.min.js:28
    _cancelModel        http://localhost:5002/kendoui/js/kendo.all.min.js:28
    cancelChanges       http://localhost:5002/kendoui/js/kendo.all.min.js:27
    cancelRow           http://localhost:5002/kendoui/js/kendo.all.min.js:52
    close               http://localhost:5002/kendoui/js/kendo.all.min.js:52
    trigger             http://localhost:5002/kendoui/js/kendo.all.min.js:25
    _close              http://localhost:5002/kendoui/js/kendo.all.min.js:48
    _windowActionHandler http://localhost:5002/kendoui/js/kendo.all.min.js:47
    jQuery 9
    on                  http://localhost:5002/kendoui/js/kendo.all.min.js:26
    init                http://localhost:5002/kendoui/js/kendo.all.min.js:47
    plugin/e.fn[c]/<    http://localhost:5002/kendoui/js/kendo.all.min.js:26
    jQuery 2
    c                   http://localhost:5002/kendoui/js/kendo.all.min.js:26
    _createPopupEditor  http://localhost:5002/kendoui/js/kendo.all.min.js:52 

I'm not use error event handler in DataSource.

 

0
Anton Mironov
Telerik team
answered on 30 Mar 2021, 02:49 PM

Hello Felix,

Thank you for the error stack and details provided.

I tried to replicate the pointed faulty behavior. The result could be found in the sample project(attached) that I prepared for the case (ASP.NET MVC).

It includes a Kendo UI Grid with a "PopUp" Edit Mode. Try adding a new record, click on the "Cancel" button, and observe the result.

I hope this example provides the expected result. Feel free to use it as a template or as you decide. If further assistance is needed, try to replicate the described issue in a runnable sample project(could use the attached one for the purpose) and send it back to me in this thread. Once I have it locally will try my best to resolve this one for you.

Looking forward to hearing back from you.

 

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Felix
Top achievements
Rank 1
Anton Mironov
Telerik team
Share this question
or