Hello All,
As explained in my previous Post Scrolling In List Applet , i explained how can we get scrolling in list applet from mouse scroll.
In previous post we were calling Next Record Set and Previous Record Set on scroll.
Here we will use the same approach but will navigate to Next Record and Previous Record not Full Record set.
The Code is almost the same, just a minor change in method.
pm.ExecuteMethod("InvokeMethod", "GotoNext");
Sample code:
$(appletPlaceHolder).bind('mousewheel', function (e) {
if (e.originalEvent.wheelDelta / 200 > 0) {
//console.log('scrolling up !');
e.preventDefault();
if (pm.ExecuteMethod("CanInvokeMethod", "GotoPrevious")) {
pm.ExecuteMethod("InvokeMethod", "GotoPrevious");
}
e.stopImmediatePropagation();
} else {
//console.log('scrolling down !');
e.preventDefault();
if (pm.ExecuteMethod("CanInvokeMethod", "GotoNext")) {
pm.ExecuteMethod("InvokeMethod", "GotoNext");
}
e.stopImmediatePropagation();
}
});
<<Parent Post >>
As explained in my previous Post Scrolling In List Applet , i explained how can we get scrolling in list applet from mouse scroll.
In previous post we were calling Next Record Set and Previous Record Set on scroll.
Here we will use the same approach but will navigate to Next Record and Previous Record not Full Record set.
The Code is almost the same, just a minor change in method.
pm.ExecuteMethod("InvokeMethod", "GotoNext");
Sample code:
$(appletPlaceHolder).bind('mousewheel', function (e) {
if (e.originalEvent.wheelDelta / 200 > 0) {
//console.log('scrolling up !');
e.preventDefault();
if (pm.ExecuteMethod("CanInvokeMethod", "GotoPrevious")) {
pm.ExecuteMethod("InvokeMethod", "GotoPrevious");
}
e.stopImmediatePropagation();
} else {
//console.log('scrolling down !');
e.preventDefault();
if (pm.ExecuteMethod("CanInvokeMethod", "GotoNext")) {
pm.ExecuteMethod("InvokeMethod", "GotoNext");
}
e.stopImmediatePropagation();
}
});
<<Parent Post >>
No comments:
Post a Comment