传递 DataProvider 后选择并设置 DataGridColumn 的样式
我有一个由不同数组填充的数据网格...(同一数据网格
的标题/列发生变化)...我想在数据提供程序生成数据网格后选择一列并将其加粗,然后放置它作为“最后一列”,
这就是我所拥有的......并抛出错误:
private function populateGrid(evt:Object):void {
dg.dataProvider = evt as Array;
if (dg.columns.length > 0) {
for (var i:int = 0; i < dg.columns.length; i++) {
if (dg.columns[i].dataField == '_user_total') {
DataGridColumn((dg.columns[i].dataField)).setStyle('fontWeight', 'bold');
}
}
}
}
这样我希望有一个数据网格(用于不同的数组))而不需要固定和声明列(就像在MXML中一样),但是动态,并且希望将“特定”列加粗,并放置为最后一列,在本例中为带有 dataField _user_total 的列。
I have a Datagrid thats being populated by different Arrays... (headers/columns change for the same DataGrid)...
I would like to Select a Column of the Datagrid after it was generated by the Dataprovider and Bold it, and place it as the 'last column"
This is what I have.... and throwing an error:
private function populateGrid(evt:Object):void {
dg.dataProvider = evt as Array;
if (dg.columns.length > 0) {
for (var i:int = 0; i < dg.columns.length; i++) {
if (dg.columns[i].dataField == '_user_total') {
DataGridColumn((dg.columns[i].dataField)).setStyle('fontWeight', 'bold');
}
}
}
}
This way I would like to have One Datagrid (for different Arrays) )without having the Columns fixed and declared (like in MXML), but dynamic, and would like a 'specific' column to be Bolded, and placed as the last column, in this example, the column with dataField _user_total.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以
上面的代码为我完成了
动态找到有问题的列之后...我们将其加粗!
}
So the code above does it for me
After finding the Column in question dynamically... we bold it!