richardwang232
richardwang232

Reputation: 11

ExtJS Scrolling in grid when dragging

I have an Ext.Grid.Panel with 'gridviewdragdrop' plugin on. I was able to turn on auto-scrolling when using the 'containerScroll' property.

viewConfig: {
    plugins: {
     ptype: 'gridviewdragdrop',
     containerScroll: true
    }
}

However, the area in which ScrollManager fires an event to scroll is too small (it's essentially only the length of the arrow blocks on the vertical scrollbar). Is there a way to increase this area? Could I just do something like firing the ScrollManager event whenever my pointer crosses the top or bottom boundaries of my grid when dragging?

Upvotes: 1

Views: 2107

Answers (1)

VoidMain
VoidMain

Reputation: 2047

You can use a config object to tell the plugin the threshold you want to use, like this:

viewConfig: {
    plugins: {
        ptype: 'gridviewdragdrop',
        containerScroll: {
                vthresh: 100 // this will use threshold of 100 pixels, 
                }            // so it will start scrolling at 100 pixels
                             // from the border
    }
}

Upvotes: 1

Related Questions