If I set the properties of "buttonMode
" and "useHandCursor
" to true in DataGrid
, it does not work as I expect. Only if I move the cursor to the edge between two rows, the hand cursor displayes.
What I expect is that 开发者_运维技巧no matter where the cursor is moved, it should always show hand cursor.
The following the itemRenderer
:
<?xml version="1.0" encoding="utf-8"?>
<mx:Label
xmlns:mx="http://www.adobe.com/2006/mxml"
useHandCursor="true" buttonMode="true">
<mx:Script>
<![CDATA[
import valueObject.Employee;
override public function set data(value:Object):void{
super.data = value;
var employee:Employee = value as Employee;
this.text = employee.lastName;
}
]]>
</mx:Script>
</mx:Label>
You should set useHandCursor="true" buttonMode="true" mouseChildren="false" on your ItemRenderer class. On DG you can then set useHandCursor="false" so hand cursor is not shown on DG borders and/or scrollbars.
Because when you are hoving over an "area with data" it's not the DG that's deciding what the cursor should be, it's whatever is being used as the ItemRenderer. So you should be setting the properties on the renderer, not the DG.
To solve this, please tell us what itemRenderer
you are using (i.e. a custom mx:Label) and maybe also post some code:
In theory, it works like this:
- Create e.g. a custom mx:Label and name it "MyLabel.mxml"
- Set the buttonMocde and useHandCursor properties.
- Assign "MyLabel" to the itemRenderer property of your DataGrid. Be careful to adjust for paths information if using nested folders..
精彩评论