EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on December 21, 2017, 02:01:44 AM



Title: Datagrid - OnCellOver disable scroll
Post by: devnull on December 21, 2017, 02:01:44 AM
I have a datagrid that has one column with cells containing unordered lists where the row has a fixed row height and the list style overflow = scroll.

Due to the varied length of these lists, it is necessary to scroll down to see the full list, but the problem is when using the mouse to scroll the whole table scrolls instead of just the cell which has the mouse focus.

How can I prevent the table from scrolling when the mouse is over a specific table column ???



Title: Re: Datagrid - OnCellOver disable scroll
Post by: jarry on December 21, 2017, 07:43:08 AM
Please show an example to demonstrate how the unordered list work.


Title: Re: Datagrid - OnCellOver disable scroll
Post by: devnull on December 21, 2017, 04:33:37 PM
Thanks, but the unordered list is not really the problem, the problem is the datagrid vertical scrolling.

How can I prevent the datagrid from scrolling vertically ?



Title: Re: Datagrid - OnCellOver disable scroll
Post by: jarry on December 21, 2017, 06:47:50 PM
If you don't wish the rows to be scrolled, please add the 'overflow:hidden' to the '.datagrid-body'.
Code:
<style type="text/css">
.datagrid-body{
overflow: hidden;
}
</style>


Title: Re: Datagrid - OnCellOver disable scroll
Post by: devnull on December 22, 2017, 04:25:33 AM
Hi Jarry;

I already tried that before posting this thread, it does not work.

I am using frozen columns.

Adding overflow:hidden prevents scrolling when you try and scroll on an unfozen column, but does not work when you scroll on the frozen columns.

It is the frozen columns that I need to prevent scrolling as that contains the column with my list.



Title: Re: Datagrid - OnCellOver disable scroll
Post by: jarry on December 22, 2017, 05:18:17 PM
The frozen panel bound the 'mousewheel' event, so you should also to unbind it.
Code:
$(function(){
var dc = $('#dg').data('datagrid').dc;
dc.body1.unbind('mousewheel DOMMouseScroll');
})