<mx:Canvas width="25%" height="100%" borderStyle="solid" borderColor="black" shadowDistance="0" cornerRadius="8" dropShadowEnabled="true"> <mx:Canvas id="_mask" width="100%" height="100%" borderStyle="solid" borderColor="black" cornerRadius="8"> </mx:Canvas> <mx:DataGrid id="dataGrid" width="100%" height="100%" editable="true" mask="{_mask}"> <mx:columns> <mx:DataGridColumn headerText="属性名称" dataField="attributeName" editable="false"/> <mx:DataGridColumn headerText="属性值" dataField="value" editable="true"/> </mx:columns> </mx:DataGrid> </mx:Canvas>
注意:<mx:Canvas>标签里面还有个<mx:Canvas>,里面的<mx:Canvas>就是用于遮罩<mx:DataGrid>的,其实这里就是运用的层的概念,<mx:Canvas>在<mx:DataGrid>的上层,mask就是遮罩的实现,引用的<mx:Canvas>标签的ID