You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/10/15 20:41:03 UTC
[GitHub] [royale-asjs] cristallium opened a new issue #505: ItemRenderer on
Basic DataGrid doesn't work on 0.9.6
cristallium opened a new issue #505: ItemRenderer on Basic DataGrid doesn't work on 0.9.6
URL: https://github.com/apache/royale-asjs/issues/505
Hi,
There is an issue with itemRenderer on DataGrid.
The following code show empty cells (count cells is right but no text)
```
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/express">
<fx:Script>
<![CDATA[
import org.apache.royale.collections.ArrayList;
import org.apache.royale.express.DataGrid;
import org.apache.royale.collections.ArrayList;
private function ev_clic_arl_dp():void {
mydg.dataProvider = arl;
}
private function ev_clic_ar_dp():void {
mydg.dataProvider = ar;
}
private var ar:Array = ["Bob", "Joe", "Frank", "Sally"];
private var arl:ArrayList = new ArrayList ([{label:'bob',value:'bob'},{label:'bob2',value:'bob2'},{label:'bob3',value:'bob3'}]);
]]>
</fx:Script>
<fx:Style>
@namespace js "library://ns.apache.org/royale/basic";
.DataGridColumnList .StringItemRenderer {
border-style: solid;
border-color: #CCCCCC;
border-width: 1px;
background-color: white;
line-height: 40px;
padding: 2px;
}
.DataGridColumnList .DataItemRenderer {
border-style: solid;
border-color: #CCCCCC;
border-width: 1px;
background-color: white;
line-height: 40px;
padding: 2px;
}
</fx:Style>
<js:beads>
<js:VerticalLayout/>
</js:beads>
<js:DataGrid id="mydg" x="20" y="30" width="400" height="300" rowHeight="30">
<js:columns>
<js:DataGridColumn label="Name" dataField="label" columnWidth="100%" />
<js:DataGridColumn label="Sales" dataField="value" columnWidth="80" />
</js:columns>
</js:DataGrid>
<js:TextButton text="Set ARL DP" click="ev_clic_arl_dp()"/>
<js:TextButton text="Set AR DP" click="ev_clic_ar_dp()"/>
</js:View>
```
![image](https://user-images.githubusercontent.com/6851433/66866476-a93ea300-ef99-11e9-979f-cf997f39574f.png)
When debugging js the issue is on setting data on itemRenderer :
(_DataItemRendererFactoryForArrayData.as_) function `dataProviderChangeHandler`
...
_ir.data = dp[i];_ // dp = ArrayList with right datas
jump to (_StringItemRenderer.as_)
```
org.apache.royale.html.supportClasses.StringItemRenderer.prototype.set__data = function(value) {
org.apache.royale.html.supportClasses.StringItemRenderer.superClass_.set__data.apply(this, [ value] );
this.text = this.dataToString(value);
};
```
**value** is undefined when enter function
Source code
[DataGridExample.zip](https://github.com/apache/royale-asjs/files/3731342/DataGridExample.zip)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services