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

Get returns undefined when using serverPaging

5 Answers 366 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 24 Sep 2013, 03:48 PM
Hello,

I'm using the Datasource with serverPaging where the Datasource is used by a Grid with virtual scrolling.
This works perfect except for 1 problem I'm running into.

After a cancelchanges on the Datasource the grid jumps back showing the data of the 1st Page.
When I use Datasource.get(myID), where the Model with myID is on another Page the method returns undefined.

I noticed that internally the Datasource is using an array of ranges, where 1 range contains the models of 1 page, but I don't think a Datasource.get(myID) is using those ranges.

For now i'm using a descendant of the Datasource where I implemented a findByID to use the _ranges as well.

5 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 26 Sep 2013, 08:53 AM
Hi Marcel,

Up to your questions:
  1. After a cancelchanges on the Datasource the grid jumps back showing the data of the 1st Page.

    I tried to reproduce the behaviour on a sample page, but to no avail. Could you please check it and let me know what I am missing?
    http://jsbin.com/oCehil/2/edit


  2. When I use Datasource.get(myID), where the Model with myID is on another Page the method returns undefined.

    This is expected. When serverPaging is used, the DataSource's data contains only the items from the current page.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Marcel
Top achievements
Rank 1
answered on 26 Sep 2013, 09:36 AM
Hi Alexander,

I modified your jsbin http://jsbin.com/oCehil/3/edit and was able to reproduce the problem.
- Removed Pageable option.
- Added scrollable : { virtual: true } option
- Changed editable option to editable: 'popup'.
- Changed pageSize of the dataSource to 10

Steps to reproduce:
- Scroll down to the row with OrderID 10261 to make sure the next page is fetched.
- Click the Edit button (shows the popup)
- Change the Ship Name (added some characters behind the name)
- Click Cancel

Result: The grid row with OrderID 10261 is gone. (you can see 10260 and 10262)

Regards,
Marcel
0
Alexander Valchev
Telerik team
answered on 27 Sep 2013, 07:47 AM
Hi Marcel,

Thank you for the sample.

At first I did not pay attention that you are using virtual scrolling. Please accept my apology for that.

The virtualization feature of the DataSource is special mode of the component which is oriented more to readonly scenarios thus it may give some unexpected results when used during editing. The reason for that is that virtualization uses data-prefetching in order to provide a smooth scrolling experience. As a result the pages are messed up - e.g. it is possible to display data records from two pages at the same time (page is not strictly set like in standard page mode).

In this particular case, making the pageSize larger (for example 50) fixes the issue, however in order to avoid any further problems of that kind we highly recommend to use the standard paging.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Marcel
Top achievements
Rank 1
answered on 27 Sep 2013, 08:08 AM
Hi Alexander,

So if read this reply the right way, this is a major bug which won't be fixed ?
If so, I'm sad to hear that, considering I paid for a product which turns out not to be working properly.
I do hope however that this is not the case and you guys at telerik will report this as a bug and fix it for future releases.

Regards,
Marcel
0
Alexander Valchev
Telerik team
answered on 01 Oct 2013, 06:56 AM
Hi Marcel,

I am afraid that at present virtualization and editing are two incompatible features. As I explained in my previous post, visualization mode is oriented to readonly scenarios. Currently we cannot provide a fix for this limitation that will not break any other parts of the framework logic.
Once again, please accept our apologies for the inconvenience caused.

In case using editing is mandatory for your project, please consider working with a standard pager instead of virtual scroller.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Marcel
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or