I'm working on a custom widget that uses the kendo data source's prefetch() and range() methods to work something like the virtual scrolling option for the Grid widget. Getting range 0 - 10 works as expected, but I am running into a problem when I try to retrieve the next range (10 - 20). The data source seems to be skipping ahead another page. The range returned by view() is the correct one (10 - 20), however the skip() method returns 20 instead of 10:
Is it by design that the data source automatically configures the skip and take to always return the next range? If not, I believe the cause of the issue is on line 7809 of kendo.all.js. I am currently using "Kendo UI Complete v2014.1.321".
There does not seem to be any documentation for the range(), prefetch(), inRange(), etc. online. Are these methods intended only for internal use by the framework or are they officially supported features of the data source? This is a really awesome feature of the data source, and I hope I can count on it in future versions!
Thanks!
Brian
var
skip = 0,
take = 10;
dataSource.range(skip, take);
dataSource.skip();
// 0
dataSource.take();
// 10
dataSource.range(skip + take, take);
dataSource.skip();
// 20
dataSource.take();
// 10
Is it by design that the data source automatically configures the skip and take to always return the next range? If not, I believe the cause of the issue is on line 7809 of kendo.all.js. I am currently using "Kendo UI Complete v2014.1.321".
// size = skip + take
// Using size in math.min() will always set that._skip to the start of the next range if we're "paging" forward
that._skip = skip > that.skip() ? math.min(size, (that.totalPages() - 1) * that.take()) : pageSkip;
There does not seem to be any documentation for the range(), prefetch(), inRange(), etc. online. Are these methods intended only for internal use by the framework or are they officially supported features of the data source? This is a really awesome feature of the data source, and I hope I can count on it in future versions!
Thanks!
Brian