开发者

Event to capture the scroll of a datagrid

I have 2 questions: 1. What would be the event to capture the fact a scroll has taken place in a datagrid? 2. Does any开发者_StackOverflowone have any suggestions on how one could disable the scroll of the datagrid when a user clicks a cell then drags out of the datagid?

Thanks


I'm not too familiar with the DataGrid, but here's the Class doc for the DataGrid which I was looking at.

It may be helpful to look at the horizontalScrollPolicy function.

Anyway, it doesn't look like there is a scroll event, so what I would do is capture an Event.CHANGE event on your scrollbar and look at the target's properties to find out more about the scroll position. eg

function scrollChangeHandler(event:Event):void {
    trace(event.target.percentage); // or whatever the property is.
}
scrollBar.addEventListener(Event.CHANGE, scrollChangeHandler);

Also, to kill an event you can stopPropagation on the event. eg

function mouseMoveHandler(event:MouseEvent):void {
    event.stopPropagation();
}
myItem.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);

Unfortunately, this info is only part of your answer, but at least that second tip will help a number of times down the road. Wish I knew more to help. Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜