5 Answers, 1 is accepted
You could try to use the "index" method for the focused dot in the pager:
var scrollview = $("#scrollView").data("kendoScrollView");
var pageIndex = scrollview.pager.element.find(".k-primary").index();
Hope this helps.
Regards,
Konstantin Dikov
Progress Telerik

Hi Konstantin,
Thank you for your prompt response.
The fact is that I don't want to use the pager !
Another point: the destroy() method fails (raising error) when enablePager is false. It works with the pager enabled but then all the content of the scrollview is discarded from the DOM, which seems to be bad for me !
Any clue ?
Laurent.
If you want to get the current page without using a pager, you could use the page position. Only the current page would have left 0.
function
getCurrentPage(){
var
currentPage = $(
"[data-role='page']"
).filter(
function
(idx, elem){
return
!$(elem).position().left; });
kendo.alert(
"Current Page is: "
+ currentPage.text());
}
https://dojo.telerik.com/@bubblemaster/OlaDaNuH
As far as the pager is concerned, thank you for bringing this error to our attention.
To avoid it you may override the destroy function before the widget is initialized while we have the issue logged and fixed:
kendo.ui.ScrollView.fn.destroy =
function
(){
kendo.ui.Widget.fn.destroy.call(
this
);
this
._content.destroy();
this
.pane.destroy();
if
(
this
.pager){
this
.pager.destroy();
}
this
.inner =
null
;
kendo.destroy(
this
.element);
}
I will get back to you tomorrow with more information about the issue.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Hi Alex,
Thank you for the workaround. It would be simplier to have a sort of page() method to get the current page!
About destroy() and the fact that the data-role=page content is removed from the DOM ? Is it considered as a normal behaviour ?
A last thing: it seems impossible to initialise the widget correctly with a <div id="scrollView"> hidden by default. Would be an interesting possiblity.
Best regards,
Laurent.
I have now logged this issue in our public repository and you may subscribe to it if you wish to watch its progress:
https://github.com/telerik/kendo-ui-core/issues/4890
I have also added some Telerik points to your account as a token o appreciation or helping us improve the Kendo UI ScrollView:
https://www.telerik.com/community/telerik-points
As far as the page() method suggestion, I have logged a Feature Request in the Kendo UI feedback portal on your behalf:
https://feedback.telerik.com/kendo-jquery-ui/1399295-implement-a-page-method-for-the-scrollview
The more votes it gets, the sooner it will get into our current workload.
Additionally, hidden containers are known to create issues or scrollable elements and calculations of height specifically. Using the approach described in this section of the documentation should remedy any issues:
https://docs.telerik.com/kendo-ui/controls/data-management/grid/appearance/hidden-containers
Finally, the question of whether it is normal to remove the content data-role="page" on destroying, yes, it is and it is described in the API:
https://docs.telerik.com/kendo-ui/api/javascript/ui/scrollview/methods/destroy
Regards,
Alex Hajigeorgieva
Progress Telerik