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

KendoGrid Scrolling issues in Mobile Browser

3 Answers 426 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PC
Top achievements
Rank 1
PC asked on 08 Dec 2014, 01:52 PM
I want to capture the scroll-end event of the grid to fire my custom load more results functionality. It works fine on desktop's after i attach the scroll event to k-grid-content div. But on mobile browsers the scroll event does not get fired.
Appreciate your help in advance

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 10 Dec 2014, 10:06 AM
Hello Puma,

On touch devices the Grid uses a Kendo UI Mobile Scroller widget, so you need to use its scroll event handler.

http://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/scroller#events-scroll

If exists, the widget is attached to the div.k-grid-content element.

var scroller = $("#GridID > .k-grid-content").data("kendoMobileScroller");
if (scroller) {
    scroller.bind("scroll", function(e){
        // ...
    });
}


Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
PC
Top achievements
Rank 1
answered on 10 Dec 2014, 02:26 PM
Thanks for the reply.
I actually tried that, but it seems to be very sensitive.... for example, when i scroll once, this event gets fired twice or thrice sometimes.
Also, scrollTop of the mobilescroller gives me negative zero value every now and then. 
0
Dimo
Telerik team
answered on 12 Dec 2014, 09:42 AM
Hello Puma,

Well, yes, the scroll event fires continuously during scrolling, so you will need to get the current position from the event arguments, compare it with the data table's height and decide whether to load new data items.

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#fields-table

A negative scroll offset is normal to occur, if the user drags the Grid's data area down when the first row is already visible.

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