Flex中如何通过selectionColor和selectionDisabledColor样式设置DataGrid的行选中与无效时颜色的例子
2010-04-13 11:29
986 查看
接下来的例子演示了Flex中如何通过selectionColor和selectionDisabledColor样式,设置DataGrid的行选中与无效时颜色。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码
):
下面是完整代码(或点击这里察看): Download: main.mxml<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Array id="arr"> <mx:Object c1="Item 1A" c2="Item 1B" /> <mx:Object c1="Item 2A" c2="Item 2B" /> <mx:Object c1="Item 3A" c2="Item 3B" /> <mx:Object c1="Item 4A" c2="Item 4B" /> <mx:Object c1="Item 5A" c2="Item 5B" /> <mx:Object c1="Item 6A" c2="Item 6B" /> <mx:Object c1="Item 7A" c2="Item 7B" /> <mx:Object c1="Item 8A" c2="Item 8B" /> <mx:Object c1="Item 9A" c2="Item 9B" /> </mx:Array> <mx:ApplicationControlBar dock="true"> <mx:CheckBox id="checkBox" label="enabled:" labelPlacement="left" selected="true" /> </mx:ApplicationControlBar> <mx:DataGrid id="dataGrid" dataProvider="{arr}" selectionColor="haloGreen" selectionDisabledColor="haloSilver" enabled="{checkBox.selected}" allowMultipleSelection="true" selectedIndex="3" width="300" rowCount="8"> <mx:columns> <mx:DataGridColumn dataField="c1" headerText="Column 1:" /> <mx:DataGridColumn dataField="c2" headerText="Column 2:" /> </mx:columns> </mx:DataGrid> </mx:Application> 本文转自:http://blog.minidx.com/2009/04/09/2358.html
相关文章推荐
- Flex中如何通过disabledColor样式设置NumericStepper控件无效时文本颜色的例子
- Flex中如何通过itemRollOverColor和itemSelectionColor样式给列图ColumnChart设置选中/未选颜色的例子
- Flex中通过disabledIconColor样式设置NumericStepper控件图标(icon)无效时的颜色的例子
- Flex中如何设置TextArea控件中的无效(disabled)文本颜色的例子
- Flex Gumbo中如何通过contentBackgroundColor样式,设置TextInput内文本背景颜色
- Flex中如何通过设置textAlign样式设定DateField中选中日期对齐方式的例子
- Flex中如何通过selectedButtonTextStyleName样式,设置ToggleButtonBar选中按钮文本颜色
- Flex中如何用backgroundDisabledColor样式,自定义TextInput控件在无效状态下填充颜色
- Flex中如何通过borderColor样式设置DateField控件边框颜色的例子
- Flex中如何通过设置GridLines对象的horizontalAlternateFill样式交错显示LineSeries图表背景颜色的例子
- Flex中如何通过设置separatorWidth样式来设定LinkBar控件各项目间分隔宽度的例子
- Flex中如何通过getHeaderAt()函数以及selectedUpIcon,selectedOverIcon和selectedDownIcon样式给Accordion头部设置一个分割用图标的例子
- Flex中如何通过disabledIcon样式和enabled属性在Button在改变有效/无效状态时改变图标的例子
- Flex中如何通过backgroundImage, backgroundColor和backgroundAlpha样式,设置VBox的背景图片和背景颜色以及改变透明度
- Flex中如何通过paddingTop样式设置TabNavigator控件内容与Tabs间距离的例子
- Flex中如何通过getHeaderAt()函数以及selectedUpIcon,selectedOverIcon和selectedDownIcon样式给Accordion头部设置一个分割用图标的例子
- Flex中如何通过设置cornerRadius样式设定NumericStepper控件边缘棱角圆滑幅度(corner radius)的例子
- Flex中通过backgroundColor和backgroundAlpha样式设置NumericStepper控件背景颜色和透明度的例子
- Flex中如何通过enabled属性在RadioButtonGroup中将所有的RadioButton设置为有效或无效状态的例子
- Flex中通过设置fillColors样式改变ComboBox控件的填充背景颜色的例子