我有一系列DataGrids,它们会定期从查询中提取数据。 如果该行的一列中的指定值高于某个阈值,我想突出显示整行。 因此,我需要能够解析DataGrid中的每一行,并突出显示具有高于“100”的特定值的任何行。 DataGrids中的数据量会有所不同,并且无法保证有时会有任何数据。
谢谢
'override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); var g:Graphics = graphics; g.clear(); var grid1:DataGrid = DataGrid(DataGridListData(listData).owner); //var rowtotal:int = new int(dp[0].length) ; if (grid1.isItemSelected(data) || grid1.isItemHighlighted(data)) return; if (data[DataGridListData(listData).dataField]== "NJ") { g.beginFill(0xCC0033); g.drawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); } }'I have a series of DataGrids which will pull data in from a query regularly. I want to highlight an entire row if a specified value in one column of that row is above a certain threshold. So I need to be able to parse through every row in a DataGrid and highlight any row that has a specific value above "100" say. The amount of data in the DataGrids is going to vary and there's no guarantee there will be any at times.
Thanks
'override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); var g:Graphics = graphics; g.clear(); var grid1:DataGrid = DataGrid(DataGridListData(listData).owner); //var rowtotal:int = new int(dp[0].length) ; if (grid1.isItemSelected(data) || grid1.isItemHighlighted(data)) return; if (data[DataGridListData(listData).dataField]== "NJ") { g.beginFill(0xCC0033); g.drawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); } }'最满意答案
您必须使用Itemrenderer来实现此目的。 在itemrenderer setdata方法中,您可以编写列的条件,以将行的背景颜色更改为所需的颜色。
You have to use a Itemrenderer for achieving this. In the itemrenderer setdata method you can write the condition for the column for changing the background color of the row to the desired color.
更多推荐
data,DataGrids,DataGrid,电脑培训,计算机培训,IT培训"/> <meta name="descr
发布评论