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

Newly added row disappears if you click edit and cancel.

5 Answers 376 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 04 May 2017, 01:59 PM

This occurs in the sample in the docs, regardless of the backend.

Follow this link to the documentation, and open in Dojo.
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-edit

Repro steps:
Add a new row
Click edit on new row, then click cancel.
Row disappears from grid.

If you do the same on a previously existing row, it does NOT disappear.

5 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 05 May 2017, 11:22 AM
Hi Chris,

The example you are looking at is using some hardcoded static data. When you cancel the edit command the Grid rebinds to that same static data.

However, in a real-world scenario when Grid is configured for CRUD operations the editing is working as expected. 

Please examine the demo below that illustrates editing in the Grid component.



Regards,
Georgi
Telerik by Progress
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
Corey
Top achievements
Rank 1
answered on 05 May 2017, 01:15 PM

Georgi - 

I see that the demo you linked does in fact work correctly, however, that is not representative of our implementation.  We are doing serverside filtering and paging.

The difference behavior appears to be related to the fact that upon successful save, the newly added item is not made 'pristine'.  In the provided demo, the page size of 20 is respected after save, but in our serverside implementation, a new page request is not made and therefore the page actually contains 21 items.  Editing & canceling any of the original page items works properly and editing & canceling the newly created item causes it to drop out of the view.  A page reload, or likely forcing a page requery, would bring the newly created item back into play (this time as a 'pristine' item) and it no longer disappears on edit & cancel.

0
Georgi
Telerik team
answered on 09 May 2017, 12:02 PM
Hello Chris,

The paging in the popup editing example from my previous post is also performed on the server. You can check that for yourself by opening developer tools (F12) in the browser and navigating to the Network tab. You will notice that only the items for the current page are returned from the server.

With that said, it would be hard to pinpoint what is causing the behavior you are observing. Would you send us a runnable sample where the issue is reproduced? This way we can examine the code and look for what is causing the behavior.

I am looking forward to your reply.


Regards,
Georgi
Telerik by Progress
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
Corey
Top achievements
Rank 1
answered on 09 May 2017, 01:44 PM

We will work on putting together a running example.  

However, I believe you misunderstood my previous comment, I was pointing out that the page size is not respected after a save in our implementation.  I assumed that the example provided above was doing a 'page data' request after the save, but that is not what I found...

Reviewing the network tab,  I see the following behavior:

Load: Products?callback=jQuery...

Save: Create?callback=jQuery...

However, after 'Create' I don't see a new 'Products' request, so I have to assume that the grid internally drops an item off of the page to compensate for the newly saved item.

Our implementation does not seem to behave that way, we seem to have 21 items after the 'create'.

 

0
Viktor Tachev
Telerik team
answered on 11 May 2017, 11:20 AM
Hello Corey,


It would be hard to pinpoint what is causing the behavior you are observing without further investigation. Please take your time in assembling the sample project. 

This will enable us to debug the code and look for what is causing the behavior. 


Regards,
Viktor Tachev
Telerik by Progress
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.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Corey
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or