Slickgrid - Autoscroll The Viewport When Selecting Data
I am using slickgrid for ability to enter data like excel style. User will enter data. Then after selecting required data graph will generate. Problem is , When selecting data with
Solution 1:
Add this CSS to your page
.slick-viewport { overflow-x: auto !important; overflow-y: auto !important; }
Solution 2:
I have figured out this issue by finding mouse pointer position and applied scrolling at the positions where i wanted automatic scroll ...
$('#myGrid').mousemove(function(e){
var parentOffset = $(this).offset();
diffX = ( ( parentOffset.left + $('#myGrid').width() ) - e.pageX);
diffY = ( ( parentOffset.top + $('#myGrid').width() ) - e.pageY);
if (diffX < 59 && diffX > 17){
$('.slick-viewport ').scrollLeft($('.slick-viewport ').scrollLeft() + 5);
}
if (diffY < 389 && diffY > 366){
$('.slick-viewport ').scrollTop($('.slick-viewport').scrollTop() + 5);
}
});
Post a Comment for "Slickgrid - Autoscroll The Viewport When Selecting Data"