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

lazy loading client side data source based on paging

2 Answers 359 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 Apr 2014, 10:58 PM
It looks like by default creating a dataSource with a data array automatically loops through the entire array and does some operations on all of the members.  Is there a way to suppress this or have the reading of the elements controlled by a function?  I do not want the data source to access all of the members until it has a need to do so ... maybe this need is present and I'm just unaware of it.  I have an array that I want my data source to operate.  This array lazy loads its values at the time they are accessed.  I am giving this data source to a grid with a pager. I do not want my data source items to actually load until the pager / grid needs them for display.  Unfortunately I cannot use server side paging ... I must do this all through the client.  Can anyone think of some ways this can be accomplished, either through manipulating the data source and a pager, or maybe by mocking server side paging requests in the client?  Any help would be appreciated.  

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 02 May 2014, 12:29 PM
Hi Chris,

Indeed the data source iterates all items provided in the `data` option. You can perhaps implement a custom support and enable server paging to. Here is a working sample: http://trykendoui.telerik.com/@korchev/asiF

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chris
Top achievements
Rank 1
answered on 02 May 2014, 09:01 PM
Thank you Atanas, this is exactly what I was looking for.  
Tags
Data Source
Asked by
Chris
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Chris
Top achievements
Rank 1
Share this question
or