angularjs - How to get scroll event when kendo-list-view scrolls -
i building cross platform application using angular kendo mobile.
i have kendo list using "kendo-list-view".
<div kendo-list-view >
i want event when user scrolls list, in controller.
i tried scroll event using pure angular code, mentioned in below question.
bind class toggle window scroll event
but in case nothing happens , code inside directive not getting called.
update
i have html list view below:
<kendo-mobile-view id="mylistscreen" k-transition="'slide'" k-title="'my list'" k-layout="'default'" ng-controller="mylistctrl"> <kendo-mobile-header > <kendo-mobile-nav-bar style="background-color: gray"> <kendo-view-title style="color: white"></kendo-view-title> <kendo-mobile-button k-rel="'drawer'" href="#navdrawer" k-align="'left'"><img src="img/menu.png"></kendo-mobile-button> </kendo-mobile-nav-bar> </kendo-mobile-header> <div class="mylistmaindiv"> <div kendo-list-view id="mylistviewdiv" class="mylistviewdiv" k-template="templates.mylistviewitem" k-data-source="myservice.listdatasource" ng-show="showlistselected" ></div> </div> <script id="mylistviewitem" type="text/x-kendo-template"> <div id="{{dataitem.id}}" ng-click="onselected(dataitem.id)"> {{dataitem.name}} </div> </script> </kendo-mobile-view>
i loading page in root page when user selects navigate page using kendo.mobile.application.navigate("mylist.html");
. , when controller page loads have created list using new kendo.data.datasource
, have attached new kendo.data.observablearray
data source.
you can scroll event scroller
of kendo mobile view, example if have view id="mylistscreen"
:
var kendoview = $('#mylistscreen').data().kendomobileview; var scroller = kendoview.scroller; scroller.bind("scroll", function(e) { console.log(e.scrolltop); console.log(e.scrollleft); });
you can find more info kendo scroller here on documentation
Comments
Post a Comment