[英]Highlight the maximum or minimum value in a flex advancedatagrid
我嘗試過嘗試自己做,但是失敗了,所以希望有人可以幫助您。
我有一個advancedatagrid,它顯示來自Web服務的arraycollection中的值表。 我想突出顯示行或列中的最大值或最小值。
我不關心它們的高亮顯示方式-是更改了背景,還是更改了字體顏色,或者只是使其變粗了-我只希望該特定單元格與其他單元格不同。
我正在努力尋找的是找到具有最大(或最小)值的單元格,然后更改其外觀。
在一個網格中,我要跨行進行比較,在另一個網格中,要對列進行比較。
1.)使用import mx.collections.Sort對ArrayCollection進行排序;
/* Set the ArrayCollection object's sort property and refresh the ArrayCollection. */
arrColl.sort = numericDataSort;
arrColl.refresh();
2.)根據您的排序方式獲得第一個(最小)和最后一個(最大)。
3.)將數組放入AdvancedDataGrid中,並為兩個項目設置屬性,例如:
public function myStyleFunc(data:Object,
col:AdvancedDataGridColumn):Object
{
if (data["Artist"] == artistName)
return {color:0xFF0000};
// Return null if the Artist name does not match.
return null;
}
這應該做。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.