[英]Is it possible for a datagrid with a dataprovider to have one column with a different dataprovider?
[英]Flex - Want to set different dataProvider for last column in DataGrid
我正在用四列在Flex中渲染一個DataGrid。 DataGrid的dataProvider是XMLListCollection。 我已經全部工作了。 但是,在最后一列中,我通過將該特定列的DataGridColumn的itemRenderer設置為自定義ComboBox來顯示ComboBox。 DataGrid的dataProvider沒有我想要填充ComboBox的項目。 我的問題是如何為DataGridColumn中的ComboBox提供與DataGrid不同的dataProvider。 我是否可以遍歷所有行,從每行的最后一列中獲取ComboBox並以這種方式手動進行設置?
這是DataGrid的mxml:
<mx:DataGrid dataProvider="{_ticketList}">
<mx:columns>
<mx:DataGridColumn width="220"
dataField="@package_name"
headerText="Package Name"
sortable="false" />
<mx:DataGridColumn width="166"
dataField="@barcode"
headerText="Ticket Barcode"
sortable="false" />
<mx:DataGridColumn width="100"
headerText="Ticket Blocked"
sortable="false"
itemRenderer="foo.bar.CustomCheckBox" />
<mx:DataGridColumn width="210"
headerText="Reason"
sortable="false"
itemRenderer="foo.bar.CustomComboBox" />
</mx:columns>
</mx:DataGrid>
好的,我知道了。
我有一個配置類,其中包含要由系統訪問的變量。 在我的CustomComboBox中,我只是從該配置類中提取數據並將其設置為CustomComboBox的stheProvider
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.