Hi Piotr, please you can check the changes in "DataGridView.as" gives error
when compiling the SDK:
[java]
D:\Develop_Royale\Projects\Royale-SDK\royale-asjs\frameworks\projects\Jewel\src\main\royale\org\apache\royale\jewel\beads\views\DataGridView.as(548):
col: 56 Error: Access of possibly undefined property element through a
reference with static type IChild.
[java]
[java] (newDataGridColumnList as
IChild).element.style["minWidth"] = (dataGridColumnList as
IChild).element.style["minWidth"];
Thx.
Hiedra
-----Mensaje original-----
De: Piotr Zarzycki <[email protected]>
Enviado el: viernes, 21 de junio de 2024 17:04
Para: Apache Royale Development <[email protected]>
Asunto: DataGrid with dynamically assaigend itemrenderer
Hi All,
I have in Jewel a need of having DataGrid where I can assign itemRenderer in
the code. Currently we have two options to do that
1)
<j:DataGrid>
<j:columns>
<j:DataGridColumn
itemRenderer="my.itemRenderer.MyCustomItemRenderer"/>
</j:columns>
</j:DataGrid>
2) Using css
.myClass {
IItemRenderer: ClassReference("my.itemRenderer.MyCustomItemRenderer");
}
<j:DataGrid >
<j:columns>
<j:DataGridColumn className="myClass">
</j:columns>
</j:DataGrid>
However I need something like that:
var itemRendererFactory:ClassFactory = new ClassFactory(MyCustomItemRenderer);
itemRendererFactory.properties = {property: "prop", some: false};
myDGColumn.itemRenderer=itemRendererFactory;
I have implemented this and I'm going to commit this soon. Everything was baked
in into DataGridView. I'm thinking about having separate DataGridView bead. If
someone will have any comments feedback after my commit let me know. :)
Thanks,
--
Piotr Zarzycki